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.