Home > Article > Web Front-end > How to make IE browser support html5 tag?
Html5 has been popular for a long time. It is really difficult not to study html5+css3. Today, let’s start with the most basic introduction, so that the old people of the IE family can understand the new tags of html5.
1. Add the code to the page
<!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]-->
2. Define the CSS code ( Important)
.Code
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {display:block;}
The original content of this js file is very small, and it may be updated now The version code size has increased. I didn't go into the specific differences and posted the original code. It should still be usable.
.Code
(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])}})()
If you want it, take it to your friends. Can be placed directly on the page. But pay attention to the second step, define the display:block attribute for the html5 tag.
The above is the detailed content of How to make IE browser support html5 tag?. For more information, please follow other related articles on the PHP Chinese website!