Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to add a class to the title (H1) of a view, so that a specific style could be applied. This is Drupal 6 with a Zen subtheme.


share|improve this question

If you're using Views 3, you should be able to click on Style Settings on the field, Customize field HTML. From there, you can set H1 as the HTML element or click on "Create a CSS class" to add a class.

enter image description here

share|improve this answer
  • Go to Theme Information in your view.
  • Copy the code for the entire view in the top level template.
  • Create a file named after the most specific suggestion with this code inside in your theme's template folder.
  • Add your class to the H1 element.
  • Style to your heart's content in your theme's CSS.
share|improve this answer
I'd like to add that in Drupal 6 you will need to have the base template (views-view.tpl.php) in order for the other suggestions to be picked up. They need to be in the same folder. – Beebee Mar 23 '12 at 8:56
The last answer works for my THANKS!! – user13921 Feb 20 '13 at 20:42

In the view rewrite the output of title as

<div class="H1">[title]</div> 

then u can do the styling properties for this H1 in your CSS file easily.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.