Today I'm feeling a little off. Actually a lot off. So we're going to cover something easy and quick, Multiple HTML Classes on a single element.
What I mean by multiple classes is that you can assign more than one class to an element.
For example, here is our CSS:
.white { color: #fff; }
.darkgrayBG { background-color: #666; }
Okay, two VERY simple CSS declarations, to a black background, and white text.
So here is our HTML code:
<p class="white darkgrayBG"> blah blah blah blah </p>
Okay. This text would have the black background AND the white color assigned. Very useful when creating small, utility classes that you can mix and match on the fly.
Tagged As CSS
Comments are Open (2)
Posted at 07:33 AM
Comments
David Dorward
To nitpick: There is no such thing as a 'CSS class', only a 'CSS class selector'. This is an example of using multiple HTML classes.
Posted by: David Dorward | July 15, 2004 10:45 AM
Tony
You are right. That is nitpicking.
But yes, there are no CSS Classes. There are HTML Classes, and CSS Class Selectors. W3C specs state it clearest. I'm just lazy, and don't like to type out selector.
I figured people would get the gist of what I was trying to state. But I guess being fully correct is a good thing to be.
Posted by: Tony
|
July 15, 2004 11:00 AM