No mistake. Old browsers are not aware of these new tags so all are used in line elements to solve the problem, so, there is a solution to the breakthrough is to make it a block element will not be in the same row, so that the old and new browsers can show the same effect, and the browser to identify the tag, New tags are required, the specific solution is:
IE8/IE7/IE6 supports tags generated through the Document.createelement method, which allows these browsers to support HTML5 new tags, as follows:
Document.createelement (' new label '); //Add new tag creation
Way One: Coding JavaScript
<! -- [ifltIE9]>
<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>
<! [endif]->
Copy the code to the Head section, and remember that the head section must be (because IE has to know the element before parsing the element, so the JS file cannot be called elsewhere, otherwise it will fail)
Way two: Using Google's Html5shiv package (recommended)
<! -- [ifltIE9]>
<scriptsrc= "http://Html5shiv. Googlecode. com/svn/trunk/HTML5. js"></script>
<! [endif] -->
Of course, you can also take the code out of your own eyes:
(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 (', '), I=e.length;
while (i--) {document.createelement (E[i])
}})()
Finally add this paragraph to the CSS:
/*html5*/ article,aside,dialog,footer,header,section,Footer ,nav,figure,menu{display:block}
The main thing is to make these HTML5 tags into chunks, like Div.
OK, simple, a word summed up is: reference html5.js make HTML5 tag into chunks.
--------------------------------
Refer to Lei Feng Network source code example:
< reference: http://blog.csdn.net/ptyzhu/article/details/19477695 & http://www.th7.cn/web/html-css/201404/29228.shtml>
Allow IE browser to support HTML5 new label resolution (using HTML5SHIV)