...

View Full Version : setting two values to the class attribute



shlagish
09-22-2004, 02:38 AM
Simple really, I'd like an element to have two class values.
I tried this:


<a href="#" class="class1" class="class2">link</a>

but it doesn't validate (and for obvious reasons).

So is my only solution to create a third class that combines the two?

Thanks :)

evilregis
09-22-2004, 02:52 AM
Separate classes with a space and you are cookin' with gas.




.class1 { background: #fff; }
.class2 { font-family: arial,sans-serif; }
.class3 { color: #000; }

...

<div class="class1 class2 class3">
...content...
</div>

shlagish
09-29-2004, 03:31 AM
ohhhhhhh, thanks much.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum