This article mainly introduces how to solve various IE compatibility issues (IE6-IE10) with one line of code. It is a very good method and I hope it can help everyone.
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 the head, except the title Used before other meta.
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" >
2. In some cases, we need to limit the browser’s parsing of the document to a specific version, or restrict the browser’s parsing of the document to a specific version. The processor is limited to the performance of some older versions. 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" >
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" >
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" >
Related recommendations:
How to resolve the compatibility issues regarding transparency in IE 6, 7, and 8
Solving js Date() date function browser compatibility issues