IE8 Conditional Comments
Here is an email that I received yesterday from Mike M of VoloMike and a problem that he found when trying to use conditional comments for IE8.
“So last night I discovered to my horror that if you are trying to do custom CSS for IE8 using conditional comments, your XHTML or HTML will be required to pass strict W3C validation. Otherwise, the browser may announce itself as IE7 through its conditional comments. Also, on intranets (such as when testing your website), it will announce itself as IE7.
For instance, I noticed that in IE8 they fixed the old float left/right problem where the float right would drop below (next line) of the float left. So, any CSS repositioning tweaks (via IE conditional comments) you may have been doing to bring up the rightside float by x pixels is only going to put that right float up in the air somewhere. So, I introduced an IE8 conditional comment to trigger some custom CSS to bring it back down, and to my horror I couldn’t get it to fire on my intranet.
So, the only way to trap for IE8 appears to be to use a browser quirk (such as finding something in the DOM that only applies to IE8), or asking jQuery to identify it, or using a CSS hack (one that fires only for IE8) to style it.”
Popularity: 28% [?]
Categories: CSS Tips, Posted on March 21, 2009 by Choppr | Log in



Oh, the horror!
Why can’t MS do anything right? I have a problem where IE8 seems to ignore the IE stylesheet but it still gives me the 1px-bug…
I tried it at both my localhost and the live site with the same result.
Here I was hoping we would get rid of developing for buggy browser 50% of the time…
Arrrgh frustrating.