Page is a not externally linkable
- Code, Content, and Presentation
-- CSS
---- Use efficient CSS selectors


Fotiman - 3:24 pm on Dec 9, 2009 (gmt 0)


@SuzyUK and @swa66, are you sure you're not reading more into it than is actually being said? When I view this message:


ul.tabs li a
Tag key with 2 descendant selectors and Class overly qualified with tag

I interpret that to mean exactly what it says... a tag key "ul" with 2 descendant selectors "li a" and Class ".tabs" overly qualified with tag "ul". In other words, if you're going for smallest code possible, then this would suffice:

.tabs a

Had the code been this instead:

ul li a

I would expect it to say "Tag key with 2 decendants selectors". That is, it's not saying "they would like us to add class names to every single element and use them in our CSS instead of the descendant (or any other type of existing) selectors." It's simply saying that having both the element tag AND the classname is overkill, and that having multiple descendants may be overkill as well. In no way do I read into it that they want classes on every element.


Thread source:: http://www.webmasterworld.com/css/4039425.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com