Skip to content

Instantly share code, notes, and snippets.

@bzerangue
Last active June 11, 2022 22:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bzerangue/4a412366ea5e4b96da9ff64add8d598f to your computer and use it in GitHub Desktop.
Save bzerangue/4a412366ea5e4b96da9ff64add8d598f to your computer and use it in GitHub Desktop.
Targeting IE Only - CSS Media Query
<!-- IE 9 and below... -->
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="ie9-and-below.css" />
<![endif]-->
<!--[if !IE]>-->
This is not revealed in IE 5-9. It's still revealed in other browsers.
<!--<![endif]-->
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
#myElement {
/* Enter your style code for IE10 and IE11 */
}
}
@bzerangue
Copy link
Author

IE Conditional Comments is only for IE9 and below.

IE Media Query is to target IE10 and IE11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment