I currently have some general-purpose types H1, H2, H3 for my site that are great for most "general" headers, where I need a simple "traditional" heading.
h1 { } h2 { } h3 { }
I also create some components where I have something like this, that is, I need a header specific to this type of control.
<div class="titledimage"><h1>Section header</h1><img .../></div> .titledimage h1 { color:red; bottom-border: 1px solid blue; }
The problem I am facing is that the h1 in the titledimage section titledimage also h1 , as defined earlier, so it inherits all the styles defined by h1 . This is usually undesirable - I just want red and 1px solid blue for the title in the div .titledImage .
I read and tried to answer this question about H1 styles . I came to the conclusion that if you are executing specific header styles (.titledimage h1), you cannot really create generic header styles (h1), unless:
a) you reset every style attribute in the '.titledimage h1' style b) you just use a class name instead of h1 c) your `h1` style is defined with very few attributes that you'd be overriding anyway
I noticed that they actually use H6 to style YUI menu controls , and I wonder if they do this to avoid such conflicts.
Should I
a) be using <h6> like yahoo does? b) reset every attribute defined by `h1` when I define `.titledimage h1` ? c) just use a class name for `.titledimage header`, and leave `h1`, `h2`, `h3` for 'traditional more logical headers' d) something else
Ideally, I want to say this, but theres no such thing (as far as I know)
.titledimage h1 { inherit: none; color:red; bottom-border: 1px solid blue; }
css
Simon_Weaver Mar 15 '09 at 4:21 2009-03-15 04:21
source share