> Doing this presupposes that you will only have one blue item and one red
> item on a page. What if you want to create anything else on the page with a
> blue background? I would keep them all classes and use the structure below
>
> .box {border: 1px solid black; }
> .blue{background-color: blue; }
> .red{background-color: red; }
>
> <div class="blue box"></div>
> <div class="red box"></div>
Actually you should avoid naming IDs or classes according to their
visual representation. CSS is defining how things look, but HTML
defines what things are. What if your next CSS redesign has yellow and
green boxes? An ID called "specialoffer" and a class called "warning"
makes sense in both cases.
As to the original question. It is well supported, but you need to
think about specificity. IDs weigh a lot more than classes.
http://www.molly.com/2005/10/06/css2-and-css21-specificity-clarified/
--
Chris Heilmann
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/
Binaries: http://www.onlinetools.org/
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/