Internet Explorer 8 CSS hacks
Mar25Difficulty: 




Last friday Internet Explorer 8 was launched as an official release. This will mean that lots of people will finally use it.
Allthough IE8 passed the ACID2 test, again a new browser can be painfull for the webdeveloper to support multi-browsers.
Luckily there are also IE8 CSS stylesheet hacks:
.test{
color:blue;
//color:red;
}
With this hack, all browsers will skip the line with color: red, since this is a comment line (before the property). Except for Internet Explorer. IE8 ignores it, and just change the color to red, while other browsers keep the color blue.
But there is more!
IE8 Standards-Mode Only:
.test { color /*\**/: blue\9 }
All IE versions, including IE8 Standards Mode:
.test { color: blue\9 }
Another trick, to make css styles for IE8 only, is by using conditional comment tags in your HTML:
<!--[if gte IE 8]>
<style type="text/css">
body {
color: #0000ff;
background-color: #000000;
}
</style>
<![endif]-->
Posted in browsers, css |Acid2 test, / css, / download, / hacks, / ie8, / internet explorer 8
» 6 Comments, post your comment now. »
6 Responses to “Internet Explorer 8 CSS hacks”
Hello, and thank you for a great source of information!
The IE8-standard hack “.test { color /*\**/: blue\9 }” now also applies to IE7 =/
thanks a lot to share this fixs.!
It’s Use Full
Cheers mate, this is a wicked wicked hack, a great help
![]()
thanks so much. just what i needed!
![]()