Ie6 ie7 ie8 ie9 ultimate compatibility solution, ie8ie9
Release the burden to solve the problem of low version compatibility
This is a common problem. Naturally, there are many solutions to this problem. The following are some solutions: 1. Force the use of the high-version rendering mode. Force Edge mode to parse webpage code
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
Force Chrome kernel (if installed)
<meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″/>
Problem: some earlier versions cannot be rendered normally. Permanent cure. 2. css hack is often used to compile different code condition comments for different browsers.
<! -- [If IE 6]> coding... <! [Endif] --> // ie6 <! -- [If lte IE 9]> coding... <! [Endif] --> // ie9 is smaller than or equal
Attribute prefix, many of which are not listed one by one.
_background-color:#000; //ie6*background-color:#000; //ie6 ie7
It can solve some problems and cannot use the new features of the browser. It is generally applicable to pages that are not complex. 3. js/css compatible plug-ins
The following lists some common
Html5shiv: Make the browser compatible with the HTML5 tag syntax.Respond: A fast & lightweight polyfill for min/max-width CSS3 Media Queries (for IE 6-8, and more)Bsie: Most bootstrap features are supported on IE6.IE-CSS3/PIE: Make the ie6-9 support CSS3.
In the above hack mode, the corresponding plug-ins are loaded for earlier browsers. It can solve most compatibility problems. Additional JS/CSS files are required. 4. Ultimate Solution: upgrade is prompted for earlier versions.
Determine the version of the browser. if the version is earlier, the browser prompts an upgrade or forcibly redirects to the upgrade page.
Why are you prompted for the upgrade: 1. the browser shares of earlier versions are small and gradually decrease.
Baidu collects 2016 data: Ie6 2.2%; ie7 4.4%; ie8 17.06%; ie9 5.58%.
Ie descent trend chart:
Operating System: Win xp gradually fades out (ie6), more and more win 10 users (using Edge) 2. Microsoft has completely abandoned the ie brand and pushed Edge. 3. A large amount of time and effort is wasted to be compatible with earlier browsers. 4.html 5 features are unavailable. 5. If you are reading this article, you should list some more. Discard earlier browser users and force upgrade. JS Code: page header prompt:
// The following code can be put on a page or in a js file (function (w) {if (! ("WebSocket" in w & 2 = w. webSocket. CLOSING) {var d = document. createElement ("div"); d. className = "browsehappy"; d. innerHTML = '<div> var f = function () {var s = document. getElementsByTagName ("body") [0]; if ("undefined" = typeof (s) {setTimeout (f, 10)} else {s. insertBefore (d, s. firstChild) }}; f () }} (window ));
Jump directly
// You can put it in a page or js file (function (w) {if (! ("WebSocket" in w & 2 = w. WebSocket. CLOSING) {w. location. replace ("http://browsehappy.osfipin.com/") ;}} (window ));
You can also add conditional comments to the html page.