Ie=edge,chrome=1 Meta-Information

Source: Internet
Author: User
Tags nginx server

These days, playing html5★boilerplate, notice that the meta-message has the following sentence:


Copy CodeThe code is as follows:
<meta http-equiv= "x-ua-compatible" content= "ie=edge,chrome=1" >



http-equiv= "X-ua-compatible" This is a special tag for IE8, which is used to specify how Internet Explorer 8 browser simulates the rendering of a particular version of IE, to solve the compatibility problem of IE browser.

For example, specify that the IE8 browser renders the interface using the IE6 rendering method.

Once CSS hacker commonly used to simulate IE7 rendering style code:


Copy CodeThe code is as follows:
<meta http-equiv = "x-ua-compatible" content = "Ie=emulateie7"/>



What intrigued me is that the code in the first paragraph of the article "content=" ie=edge,chrome=1 ", which literally means that IE uses Chrome's rendering method? or let IE skins use the chrome kernel behind the scenes?

Check it out, this is Google Chrome frame"google Chrome browser built-in framework-gcf". Using GCF allows the user's IE browser to look the same, but the user actually uses Chrome's kernel while browsing the Web and supports Windows XP and the IE6/7/8 of the above system.

The code mentioned in the first paragraph specifies that the page is rendered using the Chrome kernel, provided that the user has already installed Google Chrome Frame.

The official definition of it:

You can start immediately with open network technologies such as the HTML5 canvas tag, and even include technologies that are not yet supported by Internet Explorer 6, 7, or 8.
Make applications faster and more responsive with JavaScript performance enhancements.
So this code can be interpreted as: If the GCF is installed, use GCF to render the page "" Chrome=1 ", and if no GCF is installed, use the highest version of IE kernel to render" "Ie=edge".

However, the next question comes again, under W3.org's HTML5 verification tool:



A solution, for three major servers, we can configure the HTTP EQUIV rule on the server side:

Apache server, make sure that Mod_headers and mod_setenvif are available, and then in httpd.conf"the new Apache configuration file is apache2.conf" or add the following rule in. htaccess:

Copy CodeThe code is as follows:
<ifmodule mod_setenvif.c>
<ifmodule mod_headers.c>
Browsermatch Chromeframe GCF
Header Append x-ua-compatible "chrome=1" ENV=GCF
</ifmodule >
</ifmodule >

For Windows server on IIS7 or later, just modify the Web. config file and add the following information:

Copy CodeThe code is as follows:
<configuration>
<system.webServer>
<customHeaders>
<add name = "X-ua-compatible" value = "chrome=1"/>
</customHeaders>
</system.webServer>
</configuration>

In the Nginx server, only need to find ginxconf ginx.conf and edit, in the server {} area (preferably a line before the closure) add the following code:

Copy CodeThe code is as follows:
Add_header "X-ua-compatible" "Ie=edge, chrome=1"; Content = "Ie=edge,chrome=1" detailed

< meta http-equiv = "x-ua-compatible" content = "ie=edge,chrome=1"/>

This is a special tag for IE8, used to specify IE8 browser to simulate the rendering of a particular version of IE (such as people annoying IE6), to solve some of the compatibility problems, such as the specific way to simulate IE7 as follows:

< meta HTTP-EQUIV = "x-ua-compatible" content = "Ie=emulateie7"/>

But what makes me curious is that there is a value like chrome behind this tag, ie can also simulate chrome?

A quick search, only to understand that the original is not Microsoft enhanced IE, but Google did a plug-in: Google Chrome frame (google embedded browser framework GCF). This plugin can make the user's IE browser unchanged, but the user in the Web browsing, actually using the Google Chrome browser kernel, and support IE6, 7, 8 and other versions of IE browser, Google this corner digging real force!

The meta tag mentioned above is used to specify that the page is rendered using the chrome kernel after the GCF is installed.

gcf:http://code.google.com/intl/zh-cn/chrome/chromeframe/

Once the installation is complete, if you want to render a page using GCF, just precede the address of the page with GCF: Yes, for example: gcf:http://cooleep.com

But what if you want to specify the page default to use GCF for rendering at development time, and if the GCF is not installed and then rendered using the IE kernel?

is to use this tag.

Tag usage:

Read the next Chrome development document (http://www.chromium.org/developers/how-tos/chrome-frame-getting-started, need to flip-wall), below to briefly explain the syntax of this tag.

1. Most basic usage: add to the head of the page

1< meta http-equiv = "x-ua-compatible" content = "chrome=1" >

To declare that the current page is rendered with the chrome kernel.

What's more complicated is the usage that I saw at the beginning of this article:

1< meta http-equiv = "x-ua-compatible" content = "ie=edge,chrome=1"/>

The effect of this writing is that if the GCF is installed, a GCF is used to render the page, and if the GCF is installed, the highest version of the IE kernel is used for rendering.

2. Modify the HTTP header file method to enable the specified page to render using the GCF kernel:

In the HTTP header file, add the following information: x-ua-compatible:chrome=1

In the Apache server, make sure that the mod_headers and mod_setenvif files are available, and then add the following configuration information to the httpd.conf:

< Ifmodule mod_setenvif.c>

< Ifmodule mod_headers.c>

Browsermatch Chromeframe GCF

Header Append x-ua-compatible "chrome=1" ENV=GCF

On IIS7 or later servers, you only need to modify the Web. config file to add the following information:

< configuration >

< system.webserver >

< Httpprotocol >

< Customheaders >

< add name = "X-ua-compatible" value = "chrome=1"/>

</customheaders >

</ system. WebServer >

</configuration >

Ie=edge,chrome=1 Meta-Information

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.