Let IE (IE6/IE7/IE8) support HTML5 elements, we need to add the following JavaScript in the HTML header, this is a simple document.createelement declaration, using conditional annotations for IE to invoke this JS file. Other non-IE browsers such as Opera,firefox will ignore this code, and there will be no HTTP requests.
Way one: Refer to Google's html5.js file, the code content can be downloaded under their own view.
<!–[if LT ie9]>
<script src= "http://html5shiv.googlecode.com/svn/trunk/html5.js" ></script>
<! [endif]–>
Put the above code in the head tag range
Way two: oneself coding JS fix.
<script>
(function () {
if (!
/*@[email protected]* /
0) return;
var e = "abbr, article, aside, audio, canvas, DataList, Details, dialog, EventSource, figure, Footer, header, Hgroup, Mark , menu, meter, nav, output, progress, section, time, video. Split (', ');
var i= e.length;
while (i--) {
Document.createelement (E[i])
}
})()
</script>
Regardless of which way you use the above, remember to define the following in CSS in order to make these tags a block element, just like Div.
/*html5*/
Article,aside,dialog,footer,header,section,footer,nav,figure,menu{display:block}
IE (IE6/IE7/IE8) supports HTML5 tags