Let IE support HTML5

Source: Internet
Author: User

HTML5 can do a lot of things for us, the most delicious is the application of semantic tags, if you have been in chrome or other support HTML5 browser to use it, then this article will certainly be useful to you, because now you can also use the Internet Explorer HTML5.

All right! Today's topic is:html5shiv-master

Here are the html5.js files that quote Google, and the benefits are not:

<!--[if ie]> <script src= "Http://html5shiv.googlecode.com/svn/trunk/html5.js" ></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)

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

Let IE support HTML5

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.