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


JAB_Creations - 11:17 pm on Dec 15, 2009 (gmt 0)


Swa, you can't do CSS 2 until you understand CSS 1.0 just like you can't do CSS 3 until you understand CSS 2.1. I see an awful lot of nightmare excuses for CSS and a lot of positioning when positioning is not needed. People don't understand the fundamentals and so it has an echoing effect in to the higher levels of CSS. That ends up making a big mess because browser vendors end up getting a flood of bogus "bugs" or exceptionally strange approaches to something as simple as a sidebar when people don't understand how to use CSS which is why I made the point about child margins as parent padding.

Where is this Google "speed check" any way? Absolutely nothing came up on Google.

My work has evolved to approach CSS in the following manner...

*
element selectors
#ID page section (content, head, foot, side)

With the id selectors I overwrite the original element selectors where needed.

Additionally I use XHTML, not HTML. Honestly HTML5 has some massive issues that keep me from ever considering adopting it. While the context of what each divisible element on my page can't be determined by the element itself (the one thing I do find agreeable about HTML5) as they are generic for block-level elements important parts of each page on my site use fundamental values for the id attribute.

In example the major id's in their top to bottom appearance...

#body
#body #content
#body #side
#head
#head #menu

Most people don't have as much time as I have to master their understanding of things...least of all software developers who would suggest these "warnings" trying to dictate as a software developer how a web designer should do their work. I've had plenty of criticisms of software though I honestly can say I've never told a single software developer that they had to avoid using certain parts of a language (you may not use loops!) or that they can not construct classes in OOP capable languages with a devastatingly limited naming scheme.

...and 20ms? Really...honestly...I'm working on the 29th version of my site and as much as I like pursuing things to the extent of perfection I also like the victory of releasing it. Plus I still haven't achieved everything I want...so with all the work I've done and the bit of work left...really I have to weigh investment against return and 20ms against thousands of class selectors? It's an obvious loss due to the gained bloat in the sheer amount of code and you'll only end up negating the measly 20ms you're working towards in the first place even if you compress your CSS. Like anything work-related you should always consider investment versus return otherwise if you please everyone you'll end up working for free! EEP!

- John


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