IE 8 compatible: <meta http-equiv= "x-ua-compatible" content= "Ie=edge"/> x-ua-compatible explanation

Source: Internet
Author: User

Preface: The Beginning of September, the senior also really arrived. Aware of their Web page layout is still a big flaw, the next plan to take time out of work to imitate some internet company's website. By the way, the basic theory of knowledge to play well.

The first goal: Xiaomi's official website, the following will put the exercise project on GitHub.

Usually write their own code is not very standard, the most basic structure of the Web

The following information is reproduced:

  

对于IE8及以上版本,例如:

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

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

   1: <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
   1: <meta http-equiv= "x-ua-compatible" content= "Ie=emulateie8"/>

For Ie=edge

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

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

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 different page rendering modes for IE8 and 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:

<meta http-equiv= "x-ua-compatible" content= "ie=7″/>

<meta http-equiv= "x-ua-compatible" content= "ie=emulateie7″>

<meta http-equiv= "x-ua-compatible" content= "ie=emulateie8″>

But <meta http-equiv= "x-ua-compatible" content= "Ie=emulateie7″> is still the first choice.

StackOverflow original link; Http://stackoverflow.com/questions/14611264/x-ua-compatible-content-ie-9-ie-8-ie-7-ie-edge? Answertab=active#tab-top

Reprint Please specify: Forget ~ shallow think» "Translation" IE 8 compatible: x-ua-compatible explanation

IE 8 compatible: <meta http-equiv= "x-ua-compatible" content= "Ie=edge"/> x-ua-compatible explanation

Related Article

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.