Setting class in stylesheet instead of markup
I'm trying to apply my poor CSS knowledge to a little toy project I have, and it annoys me endlessly that I have to declare column widths in my HTML markup.
Is there a way that I could instead
<div class="grid_4"></div>
use something like
<div id="leftNav"></div>
and in your stylesheet apply the grid_4 class to the element with id leftNav?
In my opinion, it will look something like this.
#leftNav {
apply-class: grid_4;
}
Is there anything similar in CSS?
+3
source to share