At first, IE was actually a very aggressive browser. But after a period of dormancy, it has become a barrier in our lives. Microsoft is now restarting its challenge to other browsers, but the reality is that the new version of modern IE has lagged behind Google Chrome and Firefox. We also had to find ways to be compatible with earlier IE browsers. Here are three ways to quickly and easily make your HTML5&CSS3 website magically run in Microsoft's main browser!
Htmlshiv.js
The Html5shiv tool developed by Remy can use JavaScript to create HTML5 elements such as main,header,footer in old ie. This means using JavaScript to create new HTML5 elements that do not already exist. What is this principle? You may spend a few days not to understand, but who cares! This script is almost all the official website must use JS.
<!-- [If Lt IE 9]><script src= "Dist/html5shiv.js" ></script><! [EndIf] -
Selectivizr.js
Selectivizr.js is a magical tool that provides a large number of CSS selectors and properties that are not supported by IE, including all last-child selectors. Recently in the website revision process, I used the SELECTIVIZR, the website unexpectedly can not be distorted in the old-fashioned IE browser normal display. Here is the code snippet I used:
<!-- [If LTE IE 8]><script src= "Js/libs/selectivizr.js" ></script><! [EndIf] -
Modern new technology Web project is an indispensable JS library. It will only be loaded in old ie.
You must have seen this extremely ugly conditional judgment comment. Ugly, though, can make your Web page work the way you want it to:
<!DOCTYPE HTML><!--[If Lt IE 7]> -<!--[If IE 7]> -<!--[If IE 8]> -<!--[If IE 9]> -<!--[if (GT IE 9) |! (IE)] ><! - <HTMLLang= "en"> <!--<! [EndIf] -
This code does not require JavaScript and does not need to wait for JavaScript to load, and the CSS style you define will take effect immediately, without the style flicker that occurs due to loading delays.
Although IE is catching up with its rivals, the reality is that old-fashioned IE browsers are still quite common, especially in those developing countries. Thankfully, these tools are available in all browsers.
3 ways to make your HTML5&CSS3 website appear normally in old IE