IE8 code compatible with IE7: X-UA-compatible

Source: Internet
Author: User

 

X-UA-compatible is a newly added setting for IE8, which is not recognized by browsers other than IE8. The difference between X-UA-compatible and content = "Ie = 7" regardless of whether the page contains <! Doctype> commands all use the standard mode of Windows Internet Explorer 7. The content = "Ie = emulateie7" Mode follows <! Doctype> command. For most websites, it is the preferred compatibility mode.

 

Currently, IE8 is still in the beta version. To avoid page errors under IE8, we recommend that you use IE7 for rendering. That is, directly add the following to the meta tag of the header on the page:Code:

1. <meta http-equiv = "X-UA-compatible" content = "Ie = 7"/> in this way, we can make the page behave normally in IE8!

The fierce competition in the browser market brings Compatibility Design troubles to web design developers. The IE browser alone has several mainstream versions, such as IE6, IE7, and IE8. Of course, you can use third-party integration tools such as ietester and multi-version IE coexistence solutions to facilitate code debugging. But we always need to find a more time-saving and labor-saving method.

X-UA-compatible is a special file header tag for IE8, used to specify different page rendering modes for IE8. Due to the high utilization rate of IE6 and IE7, it is very important to enable the X-UA-compatible compatibility mode of IE8.

Sample Code for various compatibility modes:

<Meta http-equiv = "X-UA-compatible" content = "Ie = 5"/> for example, the quirks mode of Windows Internet Explorer 7 is used, this is similar to how Windows Internet Explorer 5 displays content.

<Meta http-equiv = "X-UA-compatible" content = "Ie = 7"/> whether or not the page contains <! The doctype> command uses the standard rendering mode of Windows Internet Explorer 7.

<Meta http-equiv = "X-UA-compatible" content = "Ie = 8"/> enable standard rendering mode for IE8, however, because the X-UA-compatible file header only supports IE8 or later versions, it is equivalent to redundant code.

<Meta http-equiv = "X-UA-compatible" content = "edge"/> edge mode notifies Windows Internet Explorer to display content in the highest available mode, this actually breaks the "Lock" mode.

<Meta http-equiv = "X-UA-compatible" content = "Ie = emulateie7"/> notify Windows Internet Explorer in emulateie7 mode <! Doctype> command to determine how to present the content. Standard mode commands are displayed in Windows Internet Explorer 7 standard mode, while quirks mode commands are displayed in ie5 mode. Unlike IE7, emulateie7 follows the <! Doctype> command. For most websites, it is the preferred compatibility mode.

At this stage, it was not long before IE8 was introduced to the market, and its share was not high. Therefore, it is recommended to consider compatibility with earlier versions.

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.