In-depth understanding of the specified IE browser rendering method

In-depth understanding of the specified IE browser rendering method

<meta http-equiv="X-UA-Compatible" content="IE=7" />
The above code tells IE browser that regardless of whether DTD is used to declare the document standard, IE8/9 will use IE7 engine to render the page.

<meta http-equiv="X-UA-Compatible" content="IE=8" />
The above code tells IE browser that IE8/9 will use IE8 engine to render the page.

<meta http-equiv="X-UA-Compatible" content="edge" />
The above code tells the IE browser that Windows displays the content with the highest version of IE.

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
Determines how to render the content based on the <!DOCTYPE> directive. Standards mode directives are displayed in Windows Internet Explorer 7 standards mode, while Quirks mode directives are displayed in IE5 mode. Unlike IE7 mode, EmulateIE7 mode respects the <!DOCTYPE> directive. For most sites, it is the preferred compatibility mode. For those who use IE9/IE10 and want to skip IE8 and specify rendering in IE7 and IE9, you have to use the syntax recommended by the MSDN document:

<meta http-equiv="X-UA-Compatible" content="IE=7;IE=9" />
However, the above syntax that is compatible with IE7/IE9 will cause a bug in IE8. It is found that the page is not rendered in IE7's document mode in IE8.

Correct grammar rules:

1. When defining multiple document modes, use commas (,) instead of semicolons (;) as mentioned in the documentation.

Replenish:

1. X-UA-Compatible is a new setting for IE8 and is not recognized by browsers other than IE8. This is different from content="IE=7" in that it is like using the standard mode of Windows Internet Explorer 7 regardless of whether the page contains the <!DOCTYPE> directive. The content="IE=EmulateIE7" mode follows the <!DOCTYPE> directive. For most sites, it is the preferred compatibility mode.

2. X-UA-Compatible is a special file header tag for IE8 version, which is used to specify different page rendering modes for IE8. As the usage rate of IE6 and IE7 is still high, it is very important to enable the X-UA-Compatible compatibility mode of IE8 version based on comprehensive considerations.

The following are examples of various compatibility mode codes:

<meta http-equiv="X-UA-Compatible" content="IE=5" />
It's like using Windows Internet Explorer 7's Quirks mode, which is very similar to how Windows Internet Explorer 5 displays content.

<meta http-equiv="X-UA-Compatible" content="IE=7" />
The standards rendering mode of Windows Internet Explorer 7 is used regardless of whether the page contains a <!DOCTYPE> directive.

<meta http-equiv="X-UA-Compatible" content="IE=8" />
Enables the standard rendering mode of IE8, but since the X-UA-Compatible file header only supports IE8 and above, it is equivalent to redundant code.

<meta http-equiv="X-UA-Compatible" content="edge" />
Edge mode tells Windows Internet Explorer to display content in the highest available mode, which essentially breaks Locked mode.

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
EmulateIE7 mode tells Windows Internet Explorer to use the <!DOCTYPE> directive to determine how to render content. Standards mode directives are displayed in Windows Internet Explorer 7 standards mode, while Quirks mode directives are displayed in IE5 mode. Unlike IE7 mode, EmulateIE7 mode respects the <!DOCTYPE> directive. For most sites, it is the preferred compatibility mode.

The above content is how to set IE browser rendering mode. If you need it, you can use it yourself.

<<:  CSS Transition expands and collapses elements by changing the Height

>>:  Detailed process record of Vue2 initiating requests using Axios

Recommend

Detailed explanation of how to adjust Linux command history

The bash history command in Linux system helps to...

Cross-origin image resource permissions (CORS enabled image)

The HTML specification document introduces the cr...

Solution to the problem of English letters not wrapping in Firefox

The layout of text has some formatting requiremen...

Understanding JSON (JavaScript Object Notation) in one article

Table of contents JSON appears Json structure Jso...

MySQL database architecture details

Table of contents 1. MySQL Architecture 2. Networ...

A Deep Dive into JavaScript Promises

Table of contents 1. What is Promise? 2. Why is t...

Detailed explanation of the calculation method of flex-grow and flex-shrink in flex layout

Flex(彈性布局) in CSS can flexibly control the layout...

Detailed explanation of the sticky position attribute in CSS

When developing mobile apps, you often encounter ...

A brief discussion on several situations where MySQL returns Boolean types

mysql returns Boolean type In the first case, ret...

How to monitor array changes in JavaScript

Preface When introducing defineProperty before, I...

Execution context and execution stack example explanation in JavaScript

JavaScript - Principles Series In daily developme...

Detailed graphic tutorial on installing Ubuntu 20.04 dual system on Windows 10

win10 + Ubuntu 20.04 LTS dual system installation...

Detailed explanation of MySQL custom functions and stored procedures

Preface This article mainly introduces the releva...