This article reproduced, recorded the problems encountered, for the time being not carefully studied. The role of IE=EMULATEIE7 tags
For WEB developers, text compatibility is an important issue to consider. Windows Internet Explorer 8 introduces text compatibility mode, which allows Web developers to set the browser to display Web pages in the same way as older versions, allowing developers to choose the time to update.
This document describes the text compatibility mode that is supported by Windows Internet Explorer 8, and how you can use custom headers to implement these patterns on a per-page or per-site basis. After you implement the appropriate compatibility mode, you can ensure that the site is compatible with Windows Internet Explorer 8 and later.
Various compatibility modes
Windows Internet Explorer 8 supports multiple compatibility modes, which enable different supported features and affect how content is rendered. For example
IE5 mode renders content as if it were using the Quirks mode of Windows Internet Explorer 7, which is similar to how Windows Internet Explorer 5 displays content.
IE7 mode renders content regardless of whether the page contains <! The doctype> directive, like the standard mode for Windows Internet Explorer 7, is used.
EmulateIE7 mode notifies Windows Internet Explorer to use <! The doctype> directive determines how the content is rendered. Standard mode directives are displayed in Windows Internet Explorer 7 Standard mode, while Quirks mode directives are displayed in IE5 mode. Unlike IE7 mode, EmulateIE7 mode follows <! doctype> instructions. For most Web sites, it is the preferred compatibility mode.
IE8 mode maximizes support for industry standards (including the cascading style Sheets Level 2.1 specification and the world's selectors API, and can be limited in support of the world of cascading style She ETS Level 3 Specification (working draft).
Edge mode notifies Windows Internet Explorer to display content in the highest-level available mode, which in effect destroys lock mode. For Windows Internet Explorer 8, this is equivalent to the IE8 mode. if (assuming) a future version of Windows Internet Explorer supports a higher level of compatibility mode, pages set to Edge mode will appear in the highest levels of mode supported by that version, but when viewed with Windows Internet Explorer 8 , these same pages will still appear in the IE8 mode. Because it may be unexpected to render page content in a future release of Windows Internet Explorer, it is recommended that WEB developers use Edge mode only for test pages and other non-production activities.
Specify compatibility mode on a per-page basis
To specify a text pattern for a Web page, use the META element to include the x-ua-compatible http-equiv header in the page. The following example specifies EMULATEIE7 mode compatibility.
Html:
The Content property specifies the mode of the page, for example, to mimic the behavior of Windows Internet Explorer 7, specify IE=EMULATEIE7. Similarly, you can specify Ie=5, ie=7, or ie=8 to select one of the compatibility modes. You can also specify Ie=edge to notify Windows Internet Explorer 8 to use the highest-level available mode.
The x-ua-compatible header is not case sensitive, but it must appear in the header (Head section) of the Web page before all elements except TITLE and other META elements. ( Xiaoying tried, as if no use )
Specify compatibility mode on a per-site basisYou can specify a text pattern for a Web site by using a WEB server to define a custom HTTP response header for the site. The HTTP response header is information that the WEB server attaches to a file that is sent to the browser in response to an HTTP request, which typically contains the date, size, and type of the file that was sent back.
The following documents describe the steps required to configure a WEB server to attach a custom HTTP response header to all Web pages. This causes Windows Internet Explorer 8 to use the specified text compatibility mode, such as EmulateIE7.
If you specify the default text compatibility mode by using a Web server, you can override this setting by specifying additional text compatibility modes in specific Web pages. The pattern specified in the page takes precedence over the mode specified by the server.
Using scripts to determine text compatibility mode
To use Windows Internet Explorer 8 To determine the text compatibility mode for a Web page, use the Documentmode property of the Document object. For example, type the following into the address bar of Windows Internet Explorer 8 to display the text mode of the current Web page.
javascript:alert(document.documentMode);
The Documentmode property returns the value that corresponds to the text compatibility mode of the page. For example, if the selected page supports IE8 mode, Documentmode returns 8.
Note: The Compatmode property that is introduced in Windows Internet Explorer 6 is not supported and is replaced by the Documentmode attribute that is introduced in Windows Internet Explorer 8. Applications that are currently using Compatmode can still run in Windows Internet Explorer 8, but they have been updated to use Documentmode.
If you want to use JavaScript to determine the compatibility mode of text, include code that supports older versions of Windows Internet Explorer, as shown in the following example.
Jscript:
engine = null;if (window.navigator.appname == "Microsoft internet explorer" ) { // This is a IE browser. What mode is the engine in? if (Document.documentmode) // IE8 engine = document.documentMode; else // ie 5-7 { engine = 5; // is assumed to be in quirks mode, unless otherwise proven to be another mode if (Document.compatmode) { if (Document.compatmode == "Css1compat") engine = 7; // Standard Mode } } // engine variables now contain text compatibility mode. }
The Document object used here represents an HTML document in a given browser window, which you can use to examine, modify, or add content to the document and to manipulate events in that document.
Using conditional annotations to determine text compatibility mode
If you only need to adapt to Windows Internet Explorer, The following code example demonstrates how to use conditional comments for the current or previous version.
Html:
<! doctype html public "-//w3c//dtd html 4.01 strict//en" >
Miscellaneous (Quirks) mode of IE compatibility