3 ways to make your HTML5&CSS3 website appear normally in old IE

Source: Internet
Author: User

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

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.