Why the Class Attribute in External Style Sheets Isn't Preferred

> is there any particular part about this that cannot be solved by the use
of a class attribute?

 
Yes, as you mentioned, you can narrow the influence of styling in an
external stylesheet by using the id or class attributes.
 
However, when you are programmatically building a dynamic web site "one
*varyingly styled* div tag at time", it becomes increasingly difficult to
ensure the uniqueness of each class name or id name you give to these
elements that are intended to be varyingly styled. It is very difficult to
programmatically ensure that one Global External Style sheet will properly
style a vast number of programmatically generated markup elements.
 
These potential naming conflicts can be avoid with inline CSS styling, but
with inline styling
1.    Much Redundancy ends up in the markup.
2.    Browsers don't cache inline style, it is downloaded each page load.
 
I'm currently testing the @import method (indicated by Jens Meiert).
 

Received on Thursday, 7 July 2005 16:49:20 UTC