pc端頁面添加meta標籤:X-UA-Compatible meta標籤

來源:互聯網
上載者:User

標籤:

  細心的朋友會發現下面的html代碼中多了一個<細心的朋友會發現下面的html代碼中多了一個<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />標籤!
     <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
     <meta http-equiv="Content-Language" content="gb2312" />
     <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
     <meta name="robots" content="all" />
     <meta name="googlebot" content="all" />
     <meta name="description" content="提供最新的asp源碼,php源碼,.net源碼,flash源碼,網站源碼,網頁源碼,模板,軟體下載" />
     <meta name="keywords" content="asp源碼,php源碼,.net源碼,flash源碼,網站源碼,網頁源碼,模板,軟體" />
     <title>源碼下載網 - 提供最新免費網站源碼下載</title>
     <META name="copyright" content="www.downhtml.com" />

        那這個標籤是什麼意思呢?讓我來看下msdn上的說明:
        In IE8 Beta 1, that option is the “IE=7” X-UA-Compatible tag, which instructs IE8 to display content in IE7 Standards mode. However, the scenario this doesn’t address is when IE=7 is applied as an HTTP header to a site that contains Quirks mode pages. The IE=7 HTTP header will force all pages – both Quirks and Standards – to display in IE7 Standards mode. Developers using this header while updating their sites would then have to add the “IE=5” <META> tag to each page they want to keep in Quirks mode. This logic is fine for many websites. However, if a site has lots of Quirks mode pages, or for the case where pages with frames host a mix of Strict and Quirks mode content – as brought to light by IE8 Beta 1 user feedback – the compatibility opt-out adds a bit more work than we intended.

     X-UA-Compatible是針對ie8新加的一個設定,對於ie8之外的瀏覽器是不識別的,這個區別與content="IE=7"在無論頁面是否包含<!DOCTYPE>指令,都像是使用了 Windows Internet Explorer 7的標準模式。而content="IE=EmulateIE7"模式遵循<!DOCTYPE>指令。對於多數網站來說,它是首選的相容模式。

      目前IE8尚在測試版中,所以為了避免製作出的頁面在IE8下面出現錯誤,建議直接將IE8使用IE7進行渲染。也就是直接在頁面的header的meta標籤中加入如下代碼:
<meta http-equiv="X-UA-Compatible" content="IE=7" />
這樣我們才能使得頁面在IE8裡面表現正常! http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />標籤!
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="Content-Language" content="gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta name="robots" content="all" />
<meta name="googlebot" content="all" />
<meta name="description" content="提供最新的asp源碼,php源碼,.net源碼,flash源碼,網站源碼,網頁源碼,模板,軟體下載" />
<meta name="keywords" content="asp源碼,php源碼,.net源碼,flash源碼,網站源碼,網頁源碼,模板,軟體" />
<title>源碼下載網 - 提供最新免費網站源碼下載</title>
<META name="copyright" content="Downhtml.com" />

  那這個標籤是什麼意思呢?讓我來看下msdn上的說明:

  In IE8 Beta 1, that option is the “IE=7” X-UA-Compatible tag, which instructs IE8 to display content in IE7 Standards mode. However, the scenario this doesn’t address is when IE=7 is applied as an HTTP header to a site that contains Quirks mode pages. The IE=7 HTTP header will force all pages – both Quirks and Standards – to display in IE7 Standards mode. Developers using this header while updating their sites would then have to add the “IE=5” tag to each page they want to keep in Quirks mode. This logic is fine for many websites. However, if a site has lots of Quirks mode pages, or for the case where pages with frames host a mix of Strict and Quirks mode content – as brought to light by IE8 Beta 1 user feedback – the compatibility opt-out adds a bit more work than we intended.

  X-UA-Compatible是針對ie8新加的一個設定,對於ie8之外的瀏覽器是不識別的,這個區別與content="IE=7"在無論頁面是否包含指令,都像是使用了 Windows Internet Explorer 7的標準模式。而content="IE=EmulateIE7"模式遵循指令。對於多數網站來說,它是首選的相容模式。

  目前IE8尚在測試版中,所以為了避免製作出的頁面在IE8下面出現錯誤,建議直接將IE8使用IE7進行渲染。也就是直接在頁面的header的meta標籤中加入如下代碼:
         <meta http-equiv="X-UA-Compatible" content="IE=7" />
  這樣我們才能使得頁面在IE8裡面表現正常! http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />標籤!

      文章來源 源碼下載網 ww.downhtml.com 轉載請註明出處。

pc端頁面添加meta標籤:X-UA-Compatible meta標籤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.