Explanation of the X-ua-compatible property

Source: Internet
Author: User

Problem Description:

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 the version of IE, while some use ";", which is correct?

3, I want to know ie=9; ie=8; ie=7; Ie=edge the meaning of the order.

The <! is used in the document Doctype>

Reply:

For IE8 and above versions, for example:

The code is as follows: <meta http-equiv= "x-ua-compatible" content= "IE=9; ie=8; Ie=7 "/>


Forces the browser to render according to a specific version standard. However, IE7 and the following versions are not supported. If separated by semicolons (;), there are different compatibility for different browser versions, such as

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 the IE7 standard, but IE9 are rendered according to the IE9 standard. It allows for different backwards compatibility levels. Although in real life you just have to choose one version:

The code is as follows: <meta http-equiv= "x-ua-compatible" content= "ie=8"/>


This is easier for testing and maintenance. And often the more useful way is to simulate

The code is as follows: <meta http-equiv= "x-ua-compatible" content= "Ie=emulateie8"/>


For Ie=edge

The code is as follows: <meta http-equiv= "x-ua-compatible" content= "Ie=edge"/>


This means that the browser is forced to render according to the latest standards. Just as Google's CDN uses the latest version of jquery, this is the latest version, but it may also ruin your layout due to the lack of a fixed version.

Finally, consider the following

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 to clients using the Google Chrome frame, which is not used, without any effect.

The code is as follows:
For more information, there are plenty to read here, and if you want to learn about Chromeframe (which I recommend) you can Learn about it implementation here.

Ps:x-ua-compatible is a special file header tag for the IE8 version that specifies a different page rendering mode for IE8, which is not recognized for browsers other than IE8.

At present most websites use <meta http-equiv= "x-ua-compatible" content= "ie=emulateie7″> as a compatible method of IE8. In order to avoid making the page under IE8 error, it is recommended that the IE8 be rendered directly using IE7. That is, add the following code directly to the META tag in the header of the page:

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 the first choice.

Explanation of the X-ua-compatible property

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.