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.