HTML5 shiv– let the Damned IE series Support HTML5 bar

Source: Internet
Author: User

Excerpt from: http://www.cnblogs.com/yuzhongwusan/archive/2011/11/17/2252207.html

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 used its ox x, then this article will certainly be useful to you, because now you can also use in IE HTML5.

All right! Big front end today's theme is: HTML5 Shiv

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

HTML5 shiv– let the Damned IE series Support HTML5 bar (turn)

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.