Interpretation of IE8 compatibility: x-ua-compatible property

Time:2019-10-24

Problem description:

Copy the code

The code is as follows:

<meta http-equiv=”X-UA-Compatible” content=”IE=9; IE=8; IE=7; IE=EDGE” />

1. What does this mean?

2, some examples use “, “separate IE version, and some use”; “Which is right?

3. I want to know IE=9; IE = 8; IE = 7; The meaning of IE=EDGE order.

<! Is used in the document. DOCTYPE >

Answer:

For IE8 and above, for example:

Copy the code

The code is as follows:

<meta http-equiv=”X-UA-Compatible” content=”IE=9; IE=8; IE=7″ />

Force browsers to render to specific version standards. But IE7 and below is not supported. If you use semicolon (;) Separation, different compatibility for different browser versions, for example

Copy the code

The code is as follows:

<meta http-equiv=”X-UA-Compatible” content=”IE=7; IE=9″ />

The above shows that IE8 and IE7 are rendered according to IE7 standards, but IE9 is still rendered according to IE9 standards. It allows for different levels of backward compatibility. Although in the real world, you just have to choose one version:

Copy the code

The code is as follows:

<meta http-equiv=”X-UA-Compatible” content=”IE=8″ />

This is easier for testing and maintenance. Often a more useful approach is to run simulations

Copy the code

The code is as follows:

<meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE8″ />

For IE = EDGE

Copy the code

The code is as follows:

<meta http-equiv=”X-UA-Compatible” content=”IE=Edge” />

This means that browsers are forced to render to the latest standards. Just like using the latest version of JQuery on Google’s CDN, this is according to the latest version, but it may also ruin your layout because there is no fixed version.

Finally, consider this one

Copy the code

The code is as follows:

<meta http-equiv=”X-UA-Compatible” content=”IE=Edge,chrome=1″ />

Adding “chrome=1” will allow the site to render on a client that USES a chrome Frame built into the Google browser, with no effect on one that is not.

Copy the code

The code is as follows:

For more information, there is plenty to read here, and if you want to learn about ChromeFrame (which I recommend) you can learn about its implementation here.

PS: x-ua-compatible is a special file header for IE8 version, used to specify different page rendering modes for IE8, and is not Compatible with browsers other than IE8.

Currently most websites use <meta http-equiv= “x-ua-compatible” content= “IE=EmulateIE7” > as the Compatible method of IE8. In order to avoid the production of the page under IE8 errors, it is recommended that IE8 directly use IE7 for rendering. In other words, directly add the following code in the meta tag of the header of the page:

Copy the code

The code is as follows:

<meta http-equiv=”X-UA-Compatible” content=”IE=7″ /></p>
<p><meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ ></p>
<p><meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE8″ >

But <meta http-equiv= “x-ua-compatible” content= “IE=EmulateIE7” > is still preferred.

StackOverFlow original link; http://stackoverflow.com/questions/14611264/x-ua-compatible-content-ie-9-ie-8-ie-7-ie-edge? Answertab = active# TAB – top