Enforce HTML code that does not use Compatibility view

Source: Internet
Author: User

Later in the IE8 browser version, there is a "compatibility view" that makes it impossible for many new technologies to be used. So how do you prevent the browser from automatically selecting Compatibility View, forcing IE to display content in the highest-level available mode? An HTML code is described below.

X-ua-compatible is a property that sets the compatibility mode of IE browser, which is born after the IE8 browser. There are many modes of IE8 or IE9, for example, IE8 has 4 modes: IE5.5 weird mode, IE7 standard mode, IE8 almost standard mode, IE8 Standard mode, and IE9 has 7 modes: IE5.5 weird mode, IE7 standard mode, IE8 almost standard mode, IE8 standard mode, IE9 almost standard mode, IE9 standard mode, and XML Schema.

We often use code:

<meta http-equiv= "x-ua-compatible" content= "ie=8"/>

to turn on the standard rendering mode of IE8. This approach is only appropriate when there are IE8 browsers, but then there are IE9, IE10, IE11 and so on. We can write this:

<meta http-equiv= "x-ua-compatible" content= "ie=9;ie=8;ie=7;"/>

means the first IE9, You can use IE8 without IE9. So if you write for each one, it seems to be a bit redundant.

So we change the way we use code:

<meta http-equiv= "x-ua-compatible" content= "Edge"/>

The edge mode notifies IE to display content in the highest-level available mode, which in effect destroys the "lock" mode.

Of course, we've seen code like this:

<meta http-equiv= "x-ua-compatible" content= "ie=edge,chrome=1";

is to increase the chrome=1 value to trigger Google Chrome frame, but now Google has abandoned Google Chrome frame, so don't write it.

Summary:

in <! DOCTYPE html>, use code:

1 <  http-equiv= "x-ua-compatible"  content= "Edge"/>

Triggering the standard mode, this is the most effective method.

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.