欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

drupal6 views fields css drupal6 views 字段增加css

shiping1 的头像

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

shareimprove this question
 add comment

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

shareimprove 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.
shareimprove 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.

shareimprove this answer
 add comment

Your Answer

普通分类: