Tips on disabling IE8 and IE9's compatibility view mode using HTML

Tips on disabling IE8 and IE9's compatibility view mode using HTML
Starting from IE 8, IE added a compatibility mode, which will render with a lower version of IE when enabled. But sometimes this will cause problems with the web page, so we usually add the following code in HTML to make IE use a fixed rendering mode:

Copy code
The code is as follows:

<meta http-equiv="X-UA-Compatible" content="IE=8"> <!--Render in IE8 mode-->
<meta http-equiv="X-UA-Compatible" content="IE=7"> <!-- Render in IE7 mode -->

But I encountered a situation where the page can only be displayed normally in IE8 if the compatibility mode is not used. However, if the mode is set to IE8, CSS3 will become invalid in IE9. It seems that I need to disable compatibility mode for IE8 and IE9 respectively. What should I do? You can determine the browser version in the background. If it is IE8, output content="IE=8", and if it is IE9, output content="IE=9". But this is not possible with HTML. In fact, you can simply use the following code to achieve this:

Copy code
The code is as follows:

<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">

<<:  What does it mean to add a question mark (?) after the CSS link address?

>>:  The website is grayed out. Compatible code including images supports all browsers

Blog    

Recommend

JavaScript design pattern learning adapter pattern

Table of contents Overview Code Implementation Su...

In-depth understanding of CSS @font-face performance optimization

This article mainly introduces common strategies ...

How to achieve seamless token refresh

Table of contents 1. Demand Method 1 Method 2 Met...

Ubuntu 20.04 connects to wifi (2 methods)

I recently installed Ubuntu 20.04 and found that ...

How to use nginx to simulate blue-green deployment

This article introduces blue-green deployment and...

Methods and steps to build nginx file server based on docker

1. Create a new configuration file docker_nginx.c...

About the problem of dynamic splicing src image address of img in Vue

Let's take a look at the dynamic splicing of ...

Troubleshooting the cause of 502 bad gateway error on nginx server

The server reports an error 502 when synchronizin...

CSS Skills Collection - Classics among Classics

Remove the dotted box on the link Copy code The co...

MySQL 5.7.20 zip installation tutorial

MySQL 5.7.20 zip installation, the specific conte...

How to find slow SQL statements in MySQL

How to find slow SQL statements in MySQL? This ma...

The background color or image inside the div container grows as it grows

Copy code The code is as follows: height:auto !im...

Detailed explanation of binary and varbinary data types in MySQL

Preface BINARY and VARBINARY are somewhat similar...