CSS hack for IE8 Standards Mode
Wednesday, March 11, 2009 9:01:48 PM
Well, someone had to find one eventually...:-)
IE8 Standards-Mode Only:
All IE versions, including IE8 Standards Mode:
You should probably use conditional comments instead, but sometimes a good old-fashioned CSS hack can get you out of a bind (especially when you don't want to have to grab another external stylesheet).
edit: Hmm, paul.irish in the comments mentions that this also affects IE7. I could have sworn I tested it in IE7...anyway, keep that in mind if you use it. I'll try to figure out what's up.
IE8 Standards-Mode Only:
.test { color /*\**/: blue\9 }
All IE versions, including IE8 Standards Mode:
.test { color: blue\9 }
You should probably use conditional comments instead, but sometimes a good old-fashioned CSS hack can get you out of a bind (especially when you don't want to have to grab another external stylesheet).
edit: Hmm, paul.irish in the comments mentions that this also affects IE7. I could have sworn I tested it in IE7...anyway, keep that in mind if you use it. I'll try to figure out what's up.













phpbubble # Monday, May 25, 2009 4:04:05 PM
Erick PerezChidoYo # Wednesday, June 3, 2009 9:02:01 PM
I created a button using CSS I succesfully got the hover and down states to work using ":hover" & ":active". The button works on FF, IE6, IE7, Chrome and Safari. It does not work on Opera or IE8. Well I'm more concerned about it not working on IE8. On those browsers the down state only works if you click on the right corner. Have a look here:
http://www.chidissimmo.com/mybutton/
Thanks in advanced.
Paul Irishpaul.irish # Wednesday, June 3, 2009 11:19:06 PM
See demo and writeup.
warrenz54 # Friday, June 12, 2009 8:37:31 PM
Thank You!
natsukigirl # Thursday, July 9, 2009 4:00:01 PM
.test
color: green;
.test
color /*\**/: red\9
.test
*color: blue;
_color: pink;
natsukigirl # Thursday, July 9, 2009 4:07:06 PM
natsukigirl # Wednesday, December 16, 2009 10:23:31 PM
.test {
color: red;\
color: blue;
}
/*end*/
/*\*/
html*.test {
[color: green;
]color: purple;
}/*end*/
.dummyend[id]{clear:both;}
/*\*/
* html .test {
color: pink;
}
/*end*/
@media screen and (-webkit-min-device-pixel-ratio:0) {
.test { color: black; }
}
------
* ie8 is red. standard/firefox is blue. older mozilla is green. ie7 is purple. ie6 is pink. safari is black.
hummh # Thursday, January 28, 2010 8:31:41 AM
Your code sample matches also IE7 because you used a ";"
#veinte { color/*\**/: blue\9; }
If you want to address only IE 8 you have to omit the ";".
#veinte { color/*\**/: blue\9 }
What I also found out. With this hack it is not possible to add more than one rule inside the brackets. If you need more CSS rules, than you have to write each in a separate rule.
#veinte { color/*\**/: blue\9 }
#veinte { background-color/*\**/: yellow\9 }
Jan Michael Yapyapjanmichael # Friday, March 12, 2010 5:35:00 AM
nateexperiments # Sunday, April 4, 2010 4:52:57 PM
nagaraju mondrathinagarajumondrathi # Friday, June 25, 2010 5:28:41 AM
.test { color:#f3c\0/ }allen zapienarkev # Friday, October 8, 2010 5:13:04 PM
Philippe LemesleCreation-sites-Web-Normandie # Friday, November 5, 2010 11:26:16 AM
Thanks a lot for these smart tricks pals.