HTML5 statement compatible with IE

Source: Internet
Author: User

Comments: I accidentally saw Baidu's Page code and thought of a statement. If you need it, please refer to it. <! DOCTYPE html> is an HTML5 declaration. Only IE8 or earlier versions of mainstream browser browsers are not supported, So IE enters the Quirks mode. However, the subsequent statement can forcibly specify the IE rendering mode, so <! DOCTYPE html> the declaration has no effect on IE.

HTML5 is not as strict as XHTML. For general xhtml pages, it is basically impossible to completely pass the W3C verification standard, but it can be passed after being declared as HTML5.


The Code is as follows:
<! DOCTYPE html>
<! -[If IE]>
<Meta http-equiv = "X-UA-Compatible" content = "IE = 8"/>
<! [Endif]->
<! -[If IE 7]>
<Meta http-equiv = "X-UA-Compatible" content = "IE = 7"/>
<! [Endif]->
<! -[If IE 6]>
<Meta http-equiv = "X-UA-Compatible" content = "IE = 6"/>
<! [Endif]->

About X-UA-Compatible
Currently, most websites use

<Meta http-equiv = "X-UA-Compatible" content = "IE = EmulateIE7">

As a compatible method of IE8, although Microsoft has made a huge step towards the standard, it is not clear that IE8 still has a series of strange rendering phenomena.
Who makes IE6 so much? Maybe we can have more time to care about IE8 after 2014, instead of IE6 or IE7.
Available Methods in X-UA-Compatible include:

The Code is as follows:
<Meta http-equiv = "X-UA-Compatible" content = "IE = 5">
<Meta http-equiv = "X-UA-Compatible" content = "IE = 7">
<Meta http-equiv = "X-UA-Compatible" content = "IE = 8">
<Meta http-equiv = "X-UA-Compatible" content = "IE = edge">
[Html]
The last line always displays the webpage in the latest IE version mode.
In addition
[Code]
<Meta http-equiv = "X-UA-Compatible" content = "IE = EmulateIE7">
<Meta http-equiv = "X-UA-Compatible" content = "IE = EmulateIE8">

In Emulate mode, more attention is paid to <! DOCTYPE>

Therefore, we recommend the following for cloud downloads:

The Code is as follows:
<Meta http-equiv = "X-UA-Compatible" content = "IE = EmulateIE7">

Is the first choice.

Related Article

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.