天天看點

你的網站添加X-UA-Compatible meta标簽了嗎? 

      細心的朋友會發現下面的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" />标簽!