A line of code to solve various IE compatibility problems, IE6,IE7,IE8,IE9,IE10

Source: Internet
Author: User

In the development of the Web site because of a variety of compatibility problems, for compatibility issues, in fact, IE gives a solution Google also gives a solution

Baidu also applied this program to solve the compatibility problem 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!
1. Force the use of IE8 mode to parse

<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 the use of 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 the use of 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″/>

6. Specify the browser to parse the page according to the highest standard mode
<meta http-equiv= "x-ua-compatible" content= "Ie=edge" >

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.

Reprint: http://hi.baidu.com/myplan/blog/item/cdb09dfa1fa748a99f514626.html


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.
http://blog.csdn.net/abxn2002/article/details/7312459

A line of code to solve various IE compatibility problems, IE6,IE7,IE8,IE9,IE10

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.