-----Mensagem Original-----
De: Chris Blake
Hi,
I have added page class suffix to some pages on my website giving the
<body id="page" class="corporate">.
I want to rewrite the CSS for the h1 in only the corporate pages.
However my body.corporate gets overwritten by #page styles. What order
can I layout these IDs, classes so that I only style h1 for corporate
body?
---------------------------------------------------------------------------------------------------------------
Hi all,
This happens due the classic *specificity* for CSS selectors.
body#page h1 is more specific than body.corporate h1 and override
rules for this selector.
There are two solutions:
body.corporate #somediv h1 is more specific than body#page h1
or you use de !important diretive like so:
body.corporate h1 {propertie:value !important;}
Further read:
http://www.w3.org/TR/CSS2/cascade.html#specificity
http://www.stuffandnonsense.co.uk/archives/css_specificity_wars.html
Regards
MaurĂcio
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/