The most annoying thing (nerd moment)
Wednesday February 7, 2007

I just discovered the most annoying bug ever in IE6’s interpretation of CSS...

Having multiple individual classes (not chains of classes, which I already knew didn’t work) on a div…

You would think that code that looks like this…

#DivID.class1 {}
#DivID2.class1 {}

#DivID.class2 {}
#DivID2.class2 {}

#DivID.class3 {}
#DivID2.class3 {}

... Would not pose too many problems right? Wrong! I just spent 2 hours banging my head on the keyboard trying to work out why the first definition would always work and the rest of them would simply disappear into the ether.

As it turns out for IE6 on Windows – not IE5.5 or IE7 – only the first definition is rendered. The rest just don’t work.

Solution? Get rid of the ID and rename all of the classes individually…

Sometimes I think the gods are teasing me =(

 

Commenting is closed for this article.