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

How to create a child process in nodejs

Table of contents Introduction Child Process Crea...

Implementation of fuzzy query like%% in MySQL

1, %: represents any 0 or more characters. It can...

10 very good CSS skills collection and sharing

Here, clever use of CSS techniques allows you to g...

Vue opens a new window and implements a graphic example of parameter transfer

The function I want to achieve is to open a new w...

Understand CSS3 FlexBox elastic layout in 10 minutes

Basic Introduction Features Flexbox is a CSS disp...

How to use linux commands to convert and splice audio formats

Install FFmpeg flac eric@ray:~$ sudo apt install ...

A detailed introduction to JavaScript primitive values ​​and wrapper objects

Table of contents Preface text Primitive types Pr...

Problems encountered when updating the auto-increment primary key id in Mysql

Table of contents Why update the auto-increment i...

Summary of ten Linux command aliases that can improve efficiency

Preface Engineers working in the Linux environmen...

Seven Principles of a Skilled Designer (1): Font Design

Well, you may be a design guru, or maybe that'...

Quickjs encapsulates JavaScript sandbox details

Table of contents 1. Scenario 2. Simplify the und...