Log in

View Full Version : Two Classes



blm126
10-04-2006, 03:11 AM
Is it possilble for a css rule to only effect an element based on two classes?
If so how?
I imagine you could do something like this


div.someclass.someotherclass{
somerule: somevalue;
}

or maybe


div[class*=someclass].someotherclass{
somerule: somevalue;
}

Any advice is appreciated.

djr33
10-04-2006, 03:17 AM
I don't get it.
What would the markup be on the div tag?
<div class="something" class="something else">??

Twey
10-04-2006, 04:50 PM
djr33: <div class="someclass someotherclass">
blm126: In theory, the former. Unfortunately, one browser doesn't support it. One guess which.

You can achieve roughly the same effect by countering everything defined in someclass in all the classes except someotherclass. It's rather ugly, though.

blm126
10-04-2006, 10:04 PM
Twey: thanks for the info, I was aware that IE 6 does not support. Do you know if IE 7 will?

Twey
10-05-2006, 05:55 PM
I'm told so.