Html5shiv solution to the low version of IE browser does not support the HTML5 element method

Source: Internet
Author: User

Eight years of resistance, HTML5 finally finalized, in recent years, with the prevalence of HTML5, we are also more and more in the page to use the HTML5 elements, but sad to urge is that the brain residue of IE's low version really let people crazy, we work hard to plan a good page in these IE version do not appear to be a bucket of paste. In order to make this difference between IE version can "know" HTML5 elements, open source Html5shiv present!

1, the characteristics of Html5shiv

Html5shiv's biggest feature is that those who do not recognize the HTML5 of IE browsers recognize the HTML5 element, and according to the most basic processing method to deal with the HTML5 element-block (Display:block). This prevents the brain residue of IE to our front-end personnel mutilation.

2, the use of Html5shiv method

Html5shiv the use of the method is very simple, acquiescence only need to be html5shiv to the following method in the head of the page can be.

<!--[If Lt IE 9]>
<script src= "Dist/html5shiv.min.js" ></script>
<! [endif]-->

3, the principle of Html5shiv

The principle of Html5shiv is to use the CreateElement method, This includes document.createelement and document.createdocumentfragment, dynamically adjusting the HTML5 elements of the current page, and providing the most basic style for these elements.

4, Html5shiv the official advice

A. Use min version of JS (compressed) to save bandwidth and increase loading speed;

B. must be loaded before the BODY element;

C. can be loaded before or after a page's CSS, but from the performance performance, CSS before the Html5shiv load will be more excellent.

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.