HTML5 聲明相容IE的寫法 asp.net

來源:互聯網
上載者:User
HTML5 聲明相容IE的寫法<!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]-->  關於X-UA-Compatible

目前絕大多數網站都用

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

來作為IE8的相容方法,雖然微軟將IE向標準邁進了一大步,而事實上IE8還存在一系列渲染的奇怪現象是不爭的事實。
誰讓IE6那麼多呢,或許2014年以後我們可以有更多的時間去關心IE8,而不是IE6或者IE7。
在X-UA-Compatible中可用的方法有:


<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" >

其中最後一行是永遠以最新的IE版本模式來顯示網頁的。

另外加上

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

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >

而使用,Emulate模式後則更重視<!DOCTYPE>

所以目前來說還是以

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

為首選。

微軟自己創下的罪孽讓他自己去掃吧。

<!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]-->  關於X-UA-Compatible

目前絕大多數網站都用

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

來作為IE8的相容方法,雖然微軟將IE向標準邁進了一大步,而事實上IE8還存在一系列渲染的奇怪現象是不爭的事實。
誰讓IE6那麼多呢,或許2014年以後我們可以有更多的時間去關心IE8,而不是IE6或者IE7。
在X-UA-Compatible中可用的方法有:


<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" >

其中最後一行是永遠以最新的IE版本模式來顯示網頁的。

另外加上

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

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >

而使用,Emulate模式後則更重視<!DOCTYPE>

所以目前來說還是以

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

為首選。

微軟自己創下的罪孽讓他自己去掃吧。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.