Home >Web Front-end >HTML Tutorial >Important attributes for IE8 compatibility: X-UA-Compatible

Important attributes for IE8 compatibility: X-UA-Compatible

php中世界最好的语言
php中世界最好的语言Original
2018-01-26 10:11:502167browse

This time I will bring you the important properties that are compatible with IE8 This is a practical case, let’s take a look at it.
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 "," to separate IE versions, while some use ";", which one is correct?

3. I want to know the meaning of the sequence IE=9; IE=8; IE=7; IE=EDGE.

Used1a309583e26acea4f04ca31122d8c535

Reply:

For IE8 and above, for example:

The code is as follows:

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

Force the browser to render according to a specific version standard. But it does not support IE7 and below versions. If separated by a semicolon (;), there will be different compatibility for different browser versions. For example,

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

The above shows that IE8 and IE7 will be rendered according to the IE7 standard, but IE9 will still follow the IE9 standard. render. It allows for different backward compatibility levels. Although in a real situation, you only need to choose one version:

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

This will be easier for testing and maintenance. The usually more useful way is to simulate

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

For IE=EDGE

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

, this means that the browser will be forced to render according to the latest standards. Just like using the latest version of

JQuery

on Google’s CDN, this is to follow the latest version, but it may also break your layout because there is no fixed version. Finally, consider the following

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

Adding "chrome=1" will allow sites to use Chrome Frame

Client-side rendering has no effect if it is not used.

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: .

At present, most websites use 4395140728f443f86acebf8105e1cdfa as the compatibility method for IE8. In order to avoid errors in the produced pages under IE8, it is recommended to use IE7 directly for rendering. That is, add the following code directly to the meta tag of the header of the page:

<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 4395140728f443f86acebf8105e1cdfa still is the first choice.

StackOverFlow原链接;http://stackoverflow.com/questions/14611264/x-ua-compatible-content-ie-9-ie-8-ie-7-ie-edge?answertab=active#tab-top

I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to php Chinese website

Other

related articles!

Related reading:

In HTML lists, what are the differences between dl(dt,dd), ul(li), and ol(li)


htmlHow to use the title attribute to display text when the mouse is hovering


What are the uses of the HTML head tag

The above is the detailed content of Important attributes for IE8 compatibility: X-UA-Compatible. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn