Node Class is a simple module that allows users to add custom CSS classes to any node through the node/add interface.




For Drupal 6 only

Add the following PHP snippet to your node.tpl.php

<?php print node_class($node) ?>

So your new node.tpl.php

<div id="node-<?php print $node->nid; ?>" class="<?php print node_class($node) ?> node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?>">



Tutorial: Node class (Video tutorial)

Related Module:
Node type class: This module adds class per content type.

Supporting organizations:

Project information

Releases

2.1.0 Stable release covered by the Drupal Security Team released 4 April 2026
Works with Drupal: ^8.9 || ^9 || ^10 || ^11

Adds support for Drupal 11.

Install:
2.0.1 Stable release covered by the Drupal Security Team released 28 November 2023
Works with Drupal: ^8.9 || ^9 || ^10
Install:

Development version: 2.0.x-dev updated 16 Apr 2026 at 08:55 UTC