zoukankan      html  css  js  c++  java
  • pc端页面添加meta标签: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" />标签!

          文章来源 源码下载网 ww.downhtml.com 转载请注明出处。

    一步一步,丈量脚下的路!
  • 相关阅读:
    Java equals和==的理解
    String StringBuffer StringBuilder 之间的区别
    HTTP 协议的基本知识,包括请求流程、请求方法等
    原生 XMLHttpRequest
    Java WebSocket实现简易聊天室
    Java Timer和TimerTask
    培训日报3.14(mysql,guava,穿山甲等)
    android手机卫士、3D指南针、动画精选、仿bilibli客户端、身份证银行卡识别等源码
    洛谷 P3177 [HAOI2015]树上染色
    洛谷 P2680 运输计划(NOIP2015提高组)(BZOJ4326)
  • 原文地址:https://www.cnblogs.com/lucifer-shun/p/5899828.html
Copyright © 2011-2022 走看看