Competent Classing

21st Jul 2004

I've just discovered an amazing CSS technique at Me yerweb that I wasn't aware off; I'll need to run through the code on all my sites now and strip out all the extra spans and divs.The technique allows you to apply two class styles within one class declaration, e.g.

<p class="subtotal negative">(-$422.72)</p>

... then you can declare in your stylesheet something like this:

.subtotal {font-weight: bold;}
.negative {color: red;}

I love it!