Ran acrross frustrating issue (bug?). IE6 does not seem to want to honor my second css declaration on the element I want. Strangely, it works properly in IE5 and IE7. Is anyone familiar with the bug I'm tickling or know a workaround?
PS. I have doubled up some IDs here for the example but the bug appears even when there is only one element for an Id.
<html>
<head>
<style type="text/css">
li {
font-family: "Andale Mono", "Monotype.com", monospace;
font-weight: bolder;
white-space: pre;
color: white;
}
pre {
margin: 0; padding: 0; border: 0;
}
ul li.classname-1 {
background-color: green;
}
ul li.classname-2 {
background-color: red;
}
/* THIS DOESNT WORK IN IE6
* WORKS IN FF2, OPERA9, SAFARI3, IE7, and IE5
* IE6 responds to whichever one is first
* IE6 ignores the second one
*/
ul li#ID4.other-classname-1 {
background-color: yellow;
color: black;
}
ul li#ID4.other-classname-2 {
background-color: gray;
}
</style>
</head>
<body>
<ul>
<li id="ID3" class="classname-1 other-classname-1"><pre>GREEN: #ID3.classname-1.other-classname-1</pre></li>
<li id="ID3" class="classname-2 other-classname-2"><pre>RED: #ID3.classname-2.other-classname-2</pre></li>
<li id="ID4" class="classname-1 other-classname-1"><pre>YELLOW: #ID4.classname-1.other-classname-1</pre></li>
<li id="ID4" class="classname-2 other-classname-2"><pre>GRAY: #ID4.classname-2.other-classname-2</pre></li>
</ul>
</body>
</html>