Skip to content

Instantly share code, notes, and snippets.

@jensgro jensgro/ie-hacks.css
Created Feb 23, 2012

Embed
What would you like to do?
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
You can’t perform that action at this time.