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

JavaScript array reduce() method syntax and example analysis

Preface The reduce() method receives a function a...

Best Practices for Deploying ELK7.3.0 Log Collection Service with Docker

Write at the beginning This article only covers E...

Detailed explanation of how Zabbix monitors the master-slave status of MySQL

After setting up the MySQL master-slave, you ofte...

Two ways to clear float in HTML

1. Clear floating method 1 Set the height of the ...

Several magical uses of JS ES6 spread operator

Table of contents 1. Add attributes 2. Merge mult...

HTML markup language - table tag

Click here to return to the 123WORDPRESS.COM HTML ...

Multiple ways to change the SELECT options in an HTML drop-down box

After the form is submitted, the returned HTML pag...

Use of Linux sed command

1. Function Introduction sed (Stream EDitor) is a...

When should a website place ads?

I recently discussed "advertising" with...

Vue el-date-picker dynamic limit time range case detailed explanation

There are two situations 1. Start time and end ti...

Specific use of the autoindex module in the Nginx Http module series

The main function of the brower module is to dete...

Detailed explanation of MySQL covering index

concept If the index contains all the data that m...

CentOS7 firewall and port related commands introduction

Table of contents 1. Check the current status of ...