Previous Message
Next Message

[css-d] best practice for inventing styles

Sent by Barrett, Bill on 31 January 2002 12:12

Hello all...

I have noticed that many coders will create their CSS documents with lots of
"subclasses" under DIV or SPAN, like: { blah...blah...; } { blah...blah...; }
div.banana { blah...blah...; }
div.strawberry { blah...blah...; }  ...etc.

This seems mostly redundant to have to specify the classes in your
markup anyway, right? I can see the need for subclasses under other HTML
elements, but they seem less useful under DIVs and SPANs, which are more
general markup tags.

My bigger question is: what is the most accepted/standard/professional way
to create styles? I tend to use HTML elements first to cover "default"
styles, and then get more specific with various classes, then IDs if
necessary. Very few subclasses. But when I see style sheets with lots of
DIVs and SPANs, I worry that I may be missing something.

Any thoughts?

Bill Barrett
Previous Message
Next Message

Message thread: