Skip to content

Instantly share code, notes, and snippets.

@stephenscaff
Last active August 29, 2015 14:26
Show Gist options
  • Select an option

  • Save stephenscaff/49b3b253268b6344fce4 to your computer and use it in GitHub Desktop.

Select an option

Save stephenscaff/49b3b253268b6344fce4 to your computer and use it in GitHub Desktop.
A variety of IE specific media queries and hacks. In order or awesomeness
.foo{
/*----------------------------------------------
--Target ie10+ via ms-high-contrast mq (bestest)
----------------------------------------------- */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
color: #111;
}
/*----------------------------------------------
--Target ie9+ (okay)
----------------------------------------------- */
@media screen and (min-width:0) and (min-resolution: +72dpi) {
color: #222;
}
/*----------------------------------------------
--Target ie9, 10, 11 (okayish - but pulls in latest chrome)
----------------------------------------------- */
@media screen and (min-width:0\0) {
color: #222;
}
/*----------------------------------------------
--Target ie9 only (sure, why not)
----------------------------------------------- */
@media screen and (min-width:0) and (min-resolution: .001dpcm) {
color: #333;
}
/*----------------------------------------------
--Hack: Target ie < 9, via slash-9 property hack (less than awesome)
----------------------------------------------- */
& { color:#444\9; }
/*----------------------------------------------
--Hack: Target ie 9, Doesn't work for background or font-*. (not too awesome)
----------------------------------------------- */
& { color:#555 \; }
/*----------------------------------------------
--Hack: Target ie9 via :root. Doesn't work for background or font-*. (meh)
----------------------------------------------- */
:root &{color:#666 \0 ;}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment