META Information of IE = edge, chrome = 1, chromemeta
Playing HTML5 these days★Boilerplate, note that the meta information contains the following sentence:
Copy the Code as follows:
<Meta http-equiv = "X-UA-Compatible" content = "IE = edge, chrome = 1">
Http-equiv = "X-UA-Compatible" is a dedicated identifier of IE8. It is used to specify the rendering method used by Internet Explorer 8 to simulate a specific version of IE browser, to solve IE browser compatibility issues.
For example, you can specify the IE8 browser to render the interface in IE6 rendering mode.
Code used to simulate the IE7 rendering method commonly used by css hacker:
Copy the Code as follows:
<Meta http-equiv = "X-UA-Compatible" content = "IE = EmulateIE7"/>
I'm curious about the section "content =" IE = edge, chrome = 1 "" in the Code mentioned in the first section. Does it mean to specify the chrome Rendering Method for IE? Or let IE's skin use the Chrome kernel in the background?
Check that this section is a Google Chrome Frame "Google Chrome embedded framework-GCF" developed by Google 」. GCF allows you to change the appearance of your IE browser, but you actually use the Chrome kernel when browsing the Web page, and supports IE6/7/8 for Windows XP and later systems.
The Code mentioned in the first section specifies that the page uses the Chrome kernel for rendering, provided that you have installed Google Chrome Frame.
Official definition:
■ You can use open network technology (such as the HTML5 canvas tag) to start immediately, or even technologies that are not supported by Internet Explorer 6, 7, or 8.
■ Use JavaScript performance enhancement to make applications faster and more responsive.
Therefore, this code can be interpreted as: If GCF is installed, GCF is used to render the page "" chrome = 1 "". If GCF is not installed, the "IE = edge" is rendered using the IE kernel of the highest version "」.
However, the next question comes again. In the html5 verification tool of w3.org:
For three mainstream servers, We can configure http equiv rules on the server side:
On the apache server, make sure that mod_headers and mod_setenvif are available. Then add the following rules to httpd. conf "the configuration file for the new Apache version is apache2.conf" or ". htaccess:
Copy the Code as follows:
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
BrowserMatch chromeframe gcf
Header append X-UA-Compatible "chrome = 1" env = gcf
</IfModule>
</IfModule>
In IIS7 or a later version of Windows Server, you only need to modify the web. config file and add the following information:
Copy the Code as follows:
<Configuration>
<System. webServer>
<HttpProtocol>
<CustomHeaders>
<Add name = "X-UA-Compatible" value = "chrome = 1"/>
</CustomHeaders>
</HttpProtocol>
</System. webServer>
</Configuration>
On the Nginx server, you only need to find and edit ginxconf g1_. conf and add the following code in the server {} region (preferably one line before the delimiter:
Copy the Code as follows:
Add_header "X-UA-Compatible" "IE = Edge, chrome = 1"; content = "IE = edge, chrome = 1"
<MetaHttp-equiv = "X-UA-Compatible" content = "IE = edge, chrome = 1"/>
This is a dedicated identifier of IE8. It is used to specify the IE8 browser to simulate the rendering mode of a specific version of IE browser (such as IE6), to solve some compatibility problems, for example, the method for simulating IE7 is as follows:
<Meta http-equiv = "X-UA-Compatible" content = "IE = EmulateIE7"/>
But I'm curious that there is a value like chrome after this mark. Can IE simulate chrome?
After a quick search, I realized that Microsoft did not enhance IE, but Google made a plug-in: Google Chrome Frame (Google embedded browser framework GCF ). This plug-in keeps your IE browser unchanged. However, when you browse the Web page, you actually use the Google Chrome browser kernel and support multiple ie browsers, such as IE6, 7, and 8, google is a really powerful tool!
The meta tag mentioned above is used to specify the page to use the chrome kernel for rendering after GCF is installed.
GCF: http://code.google.com/intl/zh-CN/chrome/chromeframe/
After the installation is complete, if you want to use GCF to render a page, just add gcf: Before the address of the page, for example: gcf: http://cooleep.com
However, if you want to specify that the page is first rendered using GCF by default during development, what should you do if you do not install GCF and then use the IE kernel for rendering?
This tag is used.
Tag usage:
I have read the chrome development documentation (http://www.chromium.org/javass/how-tos/chrome-frame-getting-startedand need to go over to the wall). The following describes the syntax of this tag.
1. Basic usage: Add a header to the page
1 <meta http-equiv = "X-UA-Compatible" content = "chrome = 1">
It is used to declare that the current page is rendered using the chrome kernel.
The complexity is the usage in the beginning of this article:
1 <meta http-equiv = "X-UA-Compatible" content = "IE = edge, chrome = 1"/>
In this way, if GCF is installed, GCF is used to render the page. If GCF is installed, the highest version of IE kernel is used for rendering.
2. Modify the HTTP header file to make the specified page render using the GCF kernel:
Add the following information to the HTTP header file: X-UA-Compatible: chrome = 1
On the Apache server, make sure that the mod_headers and mod_setenvif files are available and add the following configuration information to 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 a later server, you only need to modify the web. config file and add the following information:
<Configuration>
<System. webServer>
<HttpProtocol>
<CustomHeaders>
<Add name = "X-UA-Compatible" value = "chrome = 1"/>
</CustomHeaders>
</HttpProtocol>
</System. WebServer>
</Configuration>