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
- caution Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed. - Project categories: Content display, Content editing experience
- chart icon2,004 sites report using this module
- Created by h00dwynk on , updated
- shieldStable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
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: