IE (IE6/IE7/IE8) supports HTML5 tags -- 20150216, html5 -- 20150216
To enable IE (ie6/ie7/ie8) to support HTML5 elements, we need to add the following JavaScript in the HTML header, which is a simple document. createElement declaration. This js file is called for IE using conditional annotations. Opera, FireFox, and other non-ie browsers will ignore this code and there will be no http requests.
Method 1: reference the html5.js file of google. You can download and view the code content on your own.
<! -[If lt IE9]>
<Script src ="Http://html5shiv.googlecode.com/svn/trunk/html5.js> </script>
<! [Endif]->
Place the above Code in the head label range
Method 2: handle it by yourself using coding JS.
<Script>
(Function (){
If (!
/* @ Cc_on! @*/
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>
No matter which method you use, please remember to define the following in CSS to make these labels become block elements, just like div.
/* Html5 */
Article, aside, dialog, footer, header, section, footer, nav, figure, menu {display: block}