Home  >  Article  >  Web Front-end  >  How to solve various ie6-ie10 compatibility issues

How to solve various ie6-ie10 compatibility issues

php中世界最好的语言
php中世界最好的语言Original
2018-01-18 09:38:282367browse

This time I will show you how to solve various ie6-ie10 compatibility issues and what are the precautions to solve the ie6-ie10 compatibility issues. The following is a practical case, let’s take a look.

x-ua-compatible is used to specify IE browsermodel

x-ua-compatible header tag is not case sensitive Sensitive, must be used in head and 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" >

2. In some cases, we need to limit the browser's parsing of documents to a specific version, or limit the browser 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" >

I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!

Related reading:

How to use the img tag of HTML images

What are the name, id and class in HTML? What’s the difference

#How to use html form submission in HTML

The above is the detailed content of How to solve various ie6-ie10 compatibility issues. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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