Previous Message
Next Message

Cascade and selectors

Sent by Adam Kuehn on 8 February 2005 16:04


Jens Brueckmann wrote:

>Thus I wrote a small testcase with 21 nested lists (Opera users 
>beware! Rendering is extremely slow):
>http://www.j-a-b.net/tmp/specificity.html

I ran this through Mac browsers, as well.  Opera gets it wrong, as 
expected, but Mozilla 1.7, IE5, and Safari 1.2.4 all get it right.

>I wonder which one is right?

As clearly explained by John Lewis earlier, Opera is wrong.

In my opinion, it is a very minor error.  If you have selectors with 
10+ elements in them and they are causing conflicts with other 
selectors, then you need to rethink your fundamental design 
practices.  Classes and IDs can significantly reduce the length and 
increase the specificity of selectors, and almost never should you be 
relying on the cascade to help you at that level of detail.  Frankly, 
I can't even remember the last time I needed a selector with more 
than about a half dozen elements in it, and if I'm that deep in, I've 
usually got at least two IDs in there to narrow the scope.

In my opinion, Opera's rendering speed of the test page is a much 
bigger problem (but that's OT for this list).

-- 

-Adam Kuehn
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: