HTML5 Elements in Internet Explorer
I would use HTML5 for my new Blog Design. I have used HTML5 Tags like <header>
<article>
and <footer>
.
The problem is, that these elements don't work on IE 6, 7 and 8. I know that HTML5 is not supported on these IE versions. I have it tried with the modernizr script and document.createElement("header" );
JS-function.
But none of this works for me! I can't make the Tags, What can I do?
EDIT:
Thank you @all for you answers! :)
I have tried it with "html5shiv" and with the开发者_StackOverflow社区 code from armonge. But these elements are furthermore unstyled.
You should try the HTML5 shiv script..
http://code.google.com/p/html5shiv/
I think all you need so is link it in the head of your document
Quote from the source ;)
To use this script, it must be included before the
<body>
element (i.e. in the<head>
) but doesn't matter if it appears before or after the CSS - but for the sake of performance, it would make better sense to include the CSS first then this script.
Try something like this:
<!--[if lte IE 8]>
<script type="text/javascript">
(function(){
var html5elmeents = "address|article|aside|audio|canvas|command|datalist|details|dialog|figure|figcaption|footer|header|hgroup|keygen|mark|meter|menu|nav|progress|ruby|section|time|video".split('|');
for(var i = 0; i < html5elmeents.length; i++){
document.createElement(html5elmeents[i]);
}
}
)();
</script>
<![endif]-->
精彩评论