A line of code to solve various IE compatibility issues, IE6,IE7,IE8,IE9,IE10 (reprint)

Source: Internet
Author: User

In the development of the Web site inevitably because of a variety of compatibility problems, for compatibility issues, in fact, IE gave a solution Google also gave a solution Baidu also applied this program to solve the compatibility of IE
Baidu source code is as follows

<! Doctype html>
<meta http-equiv=content-type content= "text/html;charset=utf-8″>
<meta http-equiv=x-ua-compatible content=ie=emulateie7>
<title> Baidu a bit, you know </title>
<script>var wpo={start:new date*1,pid:109,page: ' Superpage '}</script>
<meta http-equiv=x-ua-compatible content=ie=emulateie7>

Can open Baidu, right-click to see the source! We can look at the file header if there is such a line of code!

The meaning of this sentence is to force the use of IE7 mode to parse the page code!

Here to send a few IE usage mode!

<meta http-equiv= "x-ua-compatible" content= "ie=8″>
2. Google Chrome frame also allows IE to use Chrome's engine:

<meta http-equiv= "x-ua-compatible" content= "chrome=1″/>
3. Force IE8 to use IE7 mode to parse

<meta http-equiv= "x-ua-compatible" content= "Ie=emulateie7″><!–ie7 mode–>
Or
<meta http-equiv= "x-ua-compatible" content= "Ie=7″><!–ie7 mode–>
4. Force IE8 to use IE6 or IE5 mode to parse

<meta http-equiv= "x-ua-compatible" content= "Ie=6″><!–ie6 mode–>

<meta http-equiv= "x-ua-compatible" content= "Ie=5″><!–ie5 mode–>
5. If a specific version of IE support requires more than one compatibility mode, such as:

<meta http-equiv= "x-ua-compatible" content= "ie=5; Ie=8″/>
Two. Set the site server to specify the default compatibility mode

If the server is itself, you can define a custom header on the server to preset a specific file compatibility mode for their site. This particular method depends on your Web server.

Input, the following Web. config file enables Microsoft Internet information Services (IIS) to define a custom header to automatically compile all pages using IE7 mode.

There's another solution, like Google's

Ie7–js is a JavaScript library (the JS library that solves the conflict between IE and the Web Standard), making Microsoft's Internet Explorer behave like a website-compliant browser, supporting more standards and supporting CSS2, CSS3 selectors. It fixes a number of HTML and CSS issues and makes transparent PNG appear correctly in IE5, IE6.

Make IE5,IE6 compatible to IE7 mode (recommended)

<!–[if LT IE 7]>
<script src= "http://ie7-js.googlecode.com/svn/version/2.0 (Beta)/ie7.js" type= "Text/javascript" ></script >
<! [endif]–>
Make IE5,IE6,IE7 compatible to IE8 mode

<!–[if LT IE 8]>
<script src= "http://ie7-js.googlecode.com/svn/version/2.0 (Beta)/ie8.js" type= "Text/javascript" ></script >
<! [endif]–>
Make IE5,IE6,IE7,IE8 compatible to IE9 mode

<!–[if LT IE 9]>
<script src= "http://ie7-js.googlecode.com/svn/version/2.1 (beta4)/ie9.js" ></script>
<! [endif]–>
Resolving PNG display issues

Just name the transparent PNG image *-trans.png

It is important to note that this method has no effect on background tiling (background-repeat) and background (background-position) and fills the entire container by default.
Third, <meta http-equiv= "x-ua-compatible" content= "ie=edge,chrome=1″/>
Create HTML5 when found such a sentence, do not know what the meaning of Baidu as follows:
The effect of this writing is that if the GCF is installed, a GCF is used to render the page, and if the GCF is not installed, the highest version of the IE kernel is used for rendering. Google Chrome frame (google embedded browser framework GCF). This plugin can keep the user's IE browser intact, but when users are browsing the web, they are actually using the Google Chrome kernel, and support IE6, 7, 8 and many other versions of IE browser.

A line of code to solve various IE compatibility issues, IE6,IE7,IE8,IE9,IE10 (reprint)

Related Article

Cloud Intelligence Leading the Digital Future

Alibaba Cloud ACtivate Online Conference, Nov. 20th & 21st, 2019 (UTC+08)

Register Now >

Starter Package

SSD Cloud server and data transfer for only $2.50 a month

Get Started >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.