Peter,

The important question is - do you know why it worked the second time
around?

The answer is that the second rule has more "specificity". Before you added
the td to the second rule, the first rule was more specific, so the second
rule was ignored.

When you added the td into the second rule, it became more specific but also
had more "specificity" (the first rule has two type selectors, the second
rule has two type selectors and a class selector). So, it was no longer
ignored, it was applied.

Does all of this make sense? If not, there is more on specificity here:
http://css.maxdesign.com.au/selectutorial/advanced_conflict.htm

Forgive me for sounding like a school teacher  :)
Russ
 


> Damn, just answered my own question.
> 
> I had this:
> 
> table td {
> background-color: #fff;
> }
> 
> table.title {
> background-color: #81a1d6;
> }
> 
> 
> But it needed to be this:
> 
> table td {
> background-color: #fff;
> }
> 
> table.title td {
> background-color: #81a1d6;
> }
> 
> Doh!
> Peter

*****************************************************
The discussion list for http://webstandardsgroup.org/
***************************************************** 

Reply via email to