Home > Web Front-end > HTML Tutorial > Use one line of code to solve various IE compatibility issues (IE6-IE10)

Use one line of code to solve various IE compatibility issues (IE6-IE10)

巴扎黑
Release: 2017-04-17 11:07:22
Original
1559 people have browsed it

This article mainly introduces a line of code to solve various IE compatibility issues (IE6-IE10), which has a good reference value. Let’s take a look at it with the editor.

x-ua-compatible is used to specify the model for IE browser to parse and compile the page

x-ua-compatible. The header tag is not case-sensitive and must be Used in head, it must be used before other meta except title.

1. Use one line of code to specify the browser to use a specific document mode.


<meta http-equiv="x-ua-compatible" content="IE=9" >
<meta http-equiv="x-ua-compatible" content="IE=8" >
<meta http-equiv="x-ua-compatible" content="IE=7" >
Copy after login

2. In some cases, we need to limit the browser’s parsing of the document to a specific version, or limit the browser to Some older versions are showing up. You can use the following method:


<meta http-equiv="x-ua-compatible" content="IE=EmulateIE9" >
<meta http-equiv="x-ua-compatible" content="IE=EmulateIE8" >
<meta http-equiv="x-ua-compatible" content="IE=EmulateIE7" >
Copy after login

Using this writing method, the browser will either use the standard mode for parsing, or use the IE5 Quirks mode for parsing.

3. For testing, we can also use the following statement to specify that the browser parses the page according to the highest standard mode.


<meta http-equiv="x-ua-compatible" content="IE=edge" >
Copy after login

4. Specification of multiple modes. We can separate multiple versions with commas. In this case, the browser will choose the highest version it supports from this list to render in standards mode. As in the example below, when browsing in IE8, the standards mode of IE7 will be used for rendering, because it does not support IE9 and IE10.


<meta http-equiv="x-ua-compatible" content="IE=7,9,10" >
Copy after login

The above is the detailed content of Use one line of code to solve various IE compatibility issues (IE6-IE10). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template