Skip to content

Instantly share code, notes, and snippets.

@Nutrox
Created January 31, 2011 16:54
Show Gist options
  • Save Nutrox/804358 to your computer and use it in GitHub Desktop.
Save Nutrox/804358 to your computer and use it in GitHub Desktop.
JavaScript - Partial HTML5 element rendering fix for MSIE
if( /MSIE [6-8]\./.test(navigator.userAgent) ) {
// These elements will be treated like <span> elements by MSIE,
// but you can use CSS to style them like any other element.
var elements = [
"article",
"aside",
"footer",
"header",
"nav",
"section"
];
while( elements.length ) {
document.createElement( elements.pop() );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment