Home >Web Front-end >H5 Tutorial >How to make IE browser support html5 tag?

How to make IE browser support html5 tag?

零下一度
零下一度Original
2017-04-25 13:47:292082browse

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

  1. <!--[if lt IE 9]>   
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>   
    <![endif]-->

2. Define the CSS code ( Important)

.Code How to make IE browser support html5 tag?

  1. 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 How to make IE browser support html5 tag?

  1. (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(
    &#39;,&#39;
    ),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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn