Skip to content

Instantly share code, notes, and snippets.

@stan
Forked from ricardozea/ie67891011-css-hacks.txt
Created March 8, 2017 15:21
Show Gist options
  • Save stan/074353cfd21e039180b1749c334b3fe9 to your computer and use it in GitHub Desktop.
Save stan/074353cfd21e039180b1749c334b3fe9 to your computer and use it in GitHub Desktop.
IE CSS hacks - IE6, 7, 8, 9, 10, 11
- To target only IE6, use:
*html or { _property:... }
- To target only IE7, use:
*+html or { *property:... } - Keep in mind that you have to put the IE7 property first within the same selector.
- To target IE8-9, use:
\9 >> p { color:#f00\9; } - http://stackoverflow.com/questions/660652/ie8-css-selector
The above solution doesn't work with font-family, so instead you need to use "\0/ !important" >> { font-family:Arial \0/ !important; }
http://dimox.net/personal-css-hacks-for-ie6-ie7-ie8/
- To target IE9+ only, use:
:root .class/#id { property:value \0/IE9; }
http://blog.vervestudios.co/blog/post/2011/05/13/IE9-Only-CSS-Hack.aspx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment