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 Google's html5.js File,Place the code in the head label range,The Code content can be downloaded and viewed by yourself.
<!–[if lt IE9]> <script src=" http://html5shiv.googlecode.com/svn/trunk/html5.js"></script ><![endif]–>
Method 2: handle it by yourself using coding Js.
<!–[if IE]><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(’,'),i=e.length;while(i–){document.createElement(e[i])}})()</script><![endif]–>
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}