Tony wrote :
Hi -
I have a really massive stylesheet, and I want to trim it down to a
more reasonable size. So, what I'm wondering is if anyone can recommend
any decent online tutorials (preferred) or maybe a book about the
subject?
Of course, I can Google for "CSS optimization" and other such queries,
but that doesn't necessarily mean the tutorials are any GOOD :) --
Which is why I'm asking your opinions.
Thanx
Usually, the mistake people do is not understanding how CSS inheritance
works. So, they over-declare, over-define CSS rules. They also create
classes for everything possible, not understanding again how inheritance
works and when a CSS property is and is not inherited.
Also, they seem to ignore most of the CSS default values of elements.
"Classitis and Divitis
A common error of beginning CSS coders is to use far too many <div> tags
and class attributes (...) Ninety-nine out of a hundred times these
complicated structures are unnecessary."
Web Page Development: best practices
http://developer.apple.com/internet/...estwebdev.html
So, reducing DOM tree depth generally also reduces the need of a complex
stylesheet.
Excellent/recommendable resource is:
Style sheet master class: part 1 - writing perfect style sheets
http://www.richinstyle.com/masterclass/perfection.html
Also good (regarding parsing purposes) is:
Writing Efficient CSS
http://developer.mozilla.org/en/docs..._Efficient_CSS
Gérard
--
remove blah to email me