IE9 Specific CSS Hack

Written by on July 21, 2011 in CSS - No comments
internet-explorer-9
Need a hack for my new least favorite browser, Internet Explorer 9?

So Internet Explorer 9 is out. As usual, I’ve found that there are cases where a hack to adjust the CSS for this browser is needed. The star * method doesn’t work. What does work is to add \0/ to your css. So your CSS might look like this:

height:20px \0/;

Update. This appears to also affect IE8. It also doesn’t work for some styles, such as color or background-color. Another hack that does work for color is adding a \9:

color:#000\9;

Problem with that is it affects at least IE7, 8 &9. You could over-ride those (see the comments below), but you’re probably better off using conditional statements.

Check back in a year for the latest IE10 CSS specific hack ;)

About the Author

Mike Ilsley "ilz" is a Boston based website designer, front-end developer, WordPress addict, owner of Beantown Design, and exclusive ThemeForest author. Check him out on Twitter, Facebook, Google+ and don't forget to subscribe to the WebDesign&Such email RSS feed. Also, check out his latest project, jQueryMobileShowcase.com.