Posted by: chimerastudios on: 16 June, 2010
If like us you’re still having problems with IE8 behaving differently to all the GOOD browsers out there, fear not. Even with all the CSS reset code you can still run into those niggly problems that hold you up, but don’t worry, because there is a simple and effective IE8 CSS hack that works with Internet Explorer 8 without causing problems for Chrome, Firefox, Opera or Safari.
All you need to do, is put a “\9″ at the end of the CSS you want to only run in IE8. To give you an example, the following will display a blue border in Chrome, Firefox and Safari, but red in Internet Explorer 8.
border:solid 10px blue;
border:solid 10px red\9;
This is because the first 3 browsers only see the first line, but IE8 sees the next line, over-riding the previous statement.
22 June, 2010 at 17:07
border: solid 10px blue; /* targets all browsers, of course */
border: solid 10px red\9; /* targets IE8, IE7 and IE6 */
*border: solid 10px yellow; /* targets IE7 and IE6 */
_border: solid 10px orange; /* targets IE6 */