Forum Moderators: not2easy

Message Too Old, No Replies

IE: don't apply this style there please!

         

tata668

2:16 am on Oct 26, 2005 (gmt 0)

10+ Year Member



In Firefox and Opera, only the first input will have the Lime background-color. In IE both do!
Why and is there a workaround? I only want the style to be applied when the input has both classes: "class1" and "class2".

====================
<html>
<head>

<style type="text/css">
input.class1.class2
{
background-color:Lime;
}
</style>

</head>
<body>
<input type="text" class="class1 class2" value="" />
<input type="text" class="class2" value="" />
</body>
</html>
====================

Thanks

Robin_reala

6:31 am on Oct 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Unfortunately IE doesn't understand multiple class declarations like this and only applies to the last class in the selector, which in this case is everything with class2 in the @class.

tata668

9:05 pm on Oct 26, 2005 (gmt 0)

10+ Year Member



Is there a workaround for that?

Fotiman

9:18 pm on Oct 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is it possible to wrap that input in another layer and assign the class to that layer? For example:

<html>
<head>

<style type="text/css">
.class1 input.class2
{
background-color:Lime;
}
</style>

</head>
<body>
<span class="class1">
<input type="text" class="class2" value="" />
</span>
<input type="text" class="class2" value="" />
</body>
</html>

tata668

11:51 pm on Oct 26, 2005 (gmt 0)

10+ Year Member



Ok, I'll try that, thanks to both of you!

(Damn IE!)