Using CSS Classes for indivdual effects - opinions?

Posted by Cool Hand Luke UK on Stack Overflow See other posts from Stack Overflow or by Cool Hand Luke UK
Published on 2010-03-31T09:39:35Z Indexed on 2010/03/31 9:43 UTC
Read the original article Hit count: 455

Filed under:
|
|
|

Hey,

Just trying to canvas some opinions here. I was wondering how people go about adding individual effects to html elements. Take this example: you have three types of h1 titles all the same size but some are black some are gold and some are white. Some have a text-shadow etc. Would you create separate CSS classes and add them do the h1 tag or would you create a new single class for each different h1 title type (with grouped CSS elements)? With singular class for each effect you can build up combos of classes in html class="gold shadow" but also how would you name them. For example its bad practice to give classes and id names associated to colours, because it doesn't define what it does well. However is this ok with textual CSS classes? Just wondering what others do, I know there are no hard and fast rules.

Cheers.

© Stack Overflow or respective owner

Related posts about css-selectors

Related posts about css