Skip to content

Instantly share code, notes, and snippets.

@jensgro
Created February 23, 2012 10:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jensgro/1892088 to your computer and use it in GitHub Desktop.
Save jensgro/1892088 to your computer and use it in GitHub Desktop.
IE-Hacks
/* based upon: https://github.com/ginader/CSS-Hacks/ */
/*IE 6 and IE 7 */
.something {*display:block;}
/* IE 6 */
body .something { _display: block;}
/* IE 6 */
* html .something { display: block;}
/* IE 6 */
*+html .something { display: block;}
/* IE 7 */
html > body .something {*display:block;}
/* IE6, IE 7, IE 8 and IE 9 */
body .something {display:block\9;}
/* IE 8 */
body .something {display:block \9; *display: none; /* overwrite for ie6 and ie7*/ }
body .something:nth-of-type(1n){ display:none; /* overwrite for ie9 which still also reads the \9 hack */}
/* IE 9+ */
/* CSS3 Selector that excludes IE prior to v9 */
body .something:nth-of-type(1n){ display:block \9; /* Hack to target IE 9 so we exclude FF, webkit, etc */ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment