> I have a question about efficient selectors. I tried Page Speed > extension for Firebug which analyzed use of efficient CSS selectors > among lots of other things. > Page Speed considered longer(#header ul li a) selectors inefficient and > recommended to fix them. > > Is there a good reason to use this kind of selector "#header ul li a > {...", instead of just "#header li a"? Is it considered best practice, > or why this is so commonly used?
That is too much work for the browser. This is a good read: http://code.google.com/speed/page-speed/docs/rendering.html In short, you want to avoid inefficient key selectors that match large numbers of elements and also avoid descendant selectors. -- Regards, Thierry www.tjkdesign.com | www.ez-css.org | @thierrykoblentz ______________________________________________________________________ css-discuss [cs...@lists.css-discuss.org] 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/