Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

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.

Thanks

share|improve this question
add comment

3 Answers

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
add comment
  • 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
add comment

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
add comment

Your Answer

 
discard

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.