for /* IE8 and below */
i can use this color : green\9;
but I need a hack which should only effect to IE8 , not to IE9, IE6 and 7
for /* IE8 and below */
i can use this color : green\9;
but I need a hack which should only effect to IE8 , not to IE9, IE6 and 7
Use conditional comments in HTML, like this:
<!--[if IE 8]>
<style>...</style>
<![endif]-->
See here: http://www.quirksmode.org/css/condcom.html
You can test for IE versions reliably and also be sure other browsers won't be confused.
Can you not use the hack you've already shown, and then use an IE7 and below hack to override it?
Use \0
.
color: green\0;
I however do recommend conditional comments since you'd like to exclude IE9 as well and it's yet unpredictable whether this hack will affect IE9 as well or not.
Regardless, I've never had the need for an IE8 specific hack. What is it, the IE8 specific problem which you'd like to solve? Is it rendering in IE8 standards mode anyway? Its renderer is pretty good.