[thelist] Another CSS question

Kevin W null at tsn.cc
Sun Jan 5 22:41:01 CST 2003


On Monday, Donald Noble wrote:
> the other thing is nested elements, is it best to put...
> 3) table tr td p{}  or  4) table p{}  or  5) td p{}

3 is more specific than 5, which is slightly (but not technically) more
specific than 4.  Depends what you want, really.  If you're specific, then
you don't risk having styles applied to elements that you don't want.  But
you do risk not having the styles applied to all of the elements.

Also, it might affect the cascade.  3 will override 5, although 4 and 5
have the same specificity.
http://www.w3.org/TR/CSS2/cascade.html#specificity

> Does anybody have any comments/hard evidence/anicdotal stories/urban
> myths that are relavant, or am I just being pedantic as usual?!?!

You are probably just being pedantic.  :-)



--
Kevin W :-)



More information about the thelist mailing list