I’m not sure I should really admit to not knowing this… but today was the first time I’d realised that the “class” attribute for elements within a HTML document can accept more than one class name. doh.
Update: Here’s a simple example. With the following in your style sheet…
.align-c { text-align: center; }
.font-b { font-weight: bold; }
You can have something like <div class=”align-c font-b”></div> to make the contents of the div tag bold and centre-aligned.
6 replies on “Multiple CSS Classes”
Cool! I didn”t know that. Could you post an example?
http://www.w3.org/QA/Tips/goodclassnames
hehe – point taken. It was only an example 😉
Dont” worry I found that out a couple months ago. I don”t think it”s common knowledge but it”s nice to know. 🙂
Same here. I only found this out a couple of months ago as well. Can”t believe I didn”t know it.
well I didn”t know that