前言:9月份开始了,大四也真正的到来了。深知自己网页布局还有很大的缺陷,接下来打算从工作中抽时间出来模仿着一些互联网公司的网站。顺便把基础理论知识打好。

  第一个目标:小米官网;后续会把练习的项目放到github上。

  平常自己写代码不是很规范,网页最基础的架构<html></html>一般用的就是DW生成的页面文件。前不久经老大调教,就改用了H5的框架结构。之前对于结构这块没有去想太多,就以为是一个基本要求的结构。今天看小米首页的活动页,看到<meta http-equiv="X-UA-Compatible" content="IE=edge" />。之前看书的时候没注意到这个,查过资料之后,了解到它其实是指定浏览器按某种方式渲染。

  以下为转载资料:

  

对于IE8及以上版本,例如:

   1: <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7" />

强制浏览器按照特定的版本标准进行渲染。但不支持IE7及以下版本。如果用分号(;)分隔,对于不同的浏览器版本就有不同的兼容性,例如

   1: <meta http-equiv="X-UA-Compatible" content="IE=7; IE=9" />

以上就表明,将IE8和IE7按照IE7标准渲染,但是IE9还是按照IE9的标准渲染。它允许有不同的向后兼容水平。尽管在真实情况中,你只要选择一种版本:

   1: <meta http-equiv="X-UA-Compatible" content="IE=8" />
 
这对于测试和维护会更加简单。而通常更加有用的方式就是进行仿真模拟
   1: <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />

对于IE=EDGE

   1: <meta http-equiv="X-UA-Compatible" content="IE=Edge" />

这意味着,会强制浏览器按照最新的标准去渲染。就像在Google’s CDN使用最新版本的JQuery一样,这是按照最新版本,但也可能由于没有固定的版本而破坏你的布局。

最后,考虑下面这个

   1: <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />

添加”chrome=1“将允许站点在使用了谷歌浏览器内嵌框架(Chrome Frame)的客户端渲染,对于没有使用的,则没有任何影响。

For more information, there is plenty to read here, and if you want to learn about ChromeFrame (which I recommend) you can learn about its implementation here.

PS:X-UA-Compatible是针对 IE8 版本的一个特殊文件头标记,用于为 IE8 指定不同的页面渲染模式,对于ie8之外的浏览器是不识别的。

目前绝大多数网站都用<meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ >来作为IE8的兼容方法。为了避免制作出的页面在IE8下面出现错误,建议直接将IE8使用IE7进行渲染。也就是直接在页面的header的meta标签中加入如下代码:

<meta http-equiv=”X-UA-Compatible” content=”IE=7″ />

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

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

但是<meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ >仍然是首选。

StackOverFlow原链接;http://stackoverflow.com/questions/14611264/x-ua-compatible-content-ie-9-ie-8-ie-7-ie-edge?answertab=active#tab-top

转载请注明:淡忘~浅思 » 【译】IE 8兼容:X-UA-Compatible的解释

IE 8兼容:<meta http-equiv="X-UA-Compatible" content="IE=edge" /> X-UA-Compatible的解释的更多相关文章

  1. 优先使用最新版本的IE 和 Chrome 内核 1 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    兼容模式 优先使用最新版本的IE 和 Chrome 内核 1 <meta http-equiv="X-UA-Compatible" content="IE=edge ...

  2. < meta http-equiv = "X-UA-Compatible" content = "IE=edge,chrome=1" />的作用

    < meta http-equiv = "X-UA-Compatible" content = "IE=edge,chrome=1" /> 介绍:这 ...

  3. < meta http-equiv = "X-UA-Compatible" content = "IE=edge,chrome=1" />

    目录(?)[-] 1 meta http-equiv  X-UA-Compatible content  chrome1 1 meta http-equiv  X-UA-Compatible cont ...

  4. <meta http-equiv="X-UA-Compatible" content="IE=Edge">

    1.X-UA-Compatible X-UA-Compatible是IE8的一个专有<meta>属性,它告诉IE8采用何种IE版本去渲染网页,在html的<head>标签中使用 ...

  5. 详解< meta http-equiv = "X-UA-Compatible" content = "IE=edge,chrome=1" />

    < meta http-equiv = "X-UA-Compatible" content = "IE=edge,chrome=1" /> 这是个是 ...

  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">的作用

    X-UA-Compatible是针对ie8新加的一个设置,对于ie8之外的浏览器是不识别的. X-UA-Compatible 是针对 IE8 版本的一个特殊文件头标记,用于为 IE8 指定不同的页面渲 ...

  7. < meta http-equiv = "X-UA-Compatible" content = "IE=edge,chrome=1" />的意义

    X-UA-Compatible是神马? X-UA-Compatible是IE8的一个专有<meta>属性,它告诉IE8采用何种IE版本去渲染网页,在html的<head>标签中 ...

  8. <meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible' />

    代码一:<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> http-eq ...

  9. 指定文件兼容性模式 < meta http-equiv = "X-UA-Compatible" content = "IE=edge,chrome=1" />的意义

    X-UA-Compatible是神马? X-UA-Compatible是IE8的一个专有<meta>属性,它告诉IE8采用何种IE版本去渲染网页,在html的<head>标签中 ...

随机推荐

  1. jxl读取excel

    String path=""; String path2=""; File file = new File(path); File file2 = new Fi ...

  2. P3879 [TJOI2010]阅读理解 题解

    P3879 [TJOI2010]阅读理解 题解 题目描述 英语老师留了N篇阅读理解作业,但是每篇英文短文都有很多生词需要查字典,为了节约时间,现在要做个统计,算一算某些生词都在哪几篇短文中出现过. 输 ...

  3. P4093 [HEOI2016/TJOI2016]序列

    题目链接 题意分析 我们假设每一个数都有一个变动范围\([L_i,R_i]\) 那么我们令\(dp[i]\)表示以\(i\)结尾的最长不下降子序列的长度 那么就是\(dp[i]=max\{dp[j]+ ...

  4. 【关于selenium自动化中,Webdriver的原理以及工作流程】

    原文地址:https://www.cnblogs.com/imyalost/p/7242747.html#4109245 作者:老 张 1.关于Webdriver 设计模式:按照Server-Clie ...

  5. 集合之五:Set接口

    set接口的简单介绍 set接口在API中的说明是:一个不包含重复元素的 collection.更确切地讲,set 不包含满足 e1.equals(e2) 的元素对 e1 和 e2,并且最多包含一个 ...

  6. 在eclips中配置maven

    可参考https://jingyan.baidu.com/article/59703552cb9b988fc00740a4.html

  7. USART列子

    #include "stm32f10x.h" void USART_INit(void) { GPIO_InitTypeDef GPIO_Initstructe; USART_In ...

  8. JAVA泛型方法与类型限定

     泛型方法可以定义在普通类中,也可以定义在泛型类中 class ArrayAlg{ public static <T> T getMiddle(T...a){ return a[a.len ...

  9. php7 中?? 和 ?:的区别

    $b = $a?? $c ;相当于$b= isset($a)?$a:$c; $b = $a?: $c ;则是 $b = !empty($a) ? $a:$c;

  10. SpringBoot内嵌Tomcat开启APR模式(运行环境为Centos7)

    网上查到的一些springboot内嵌的tomcat开启apr的文章,好像使用的springboot版本较老,在SpringBoot 2.0.4.RELEASE中已经行不通了.自己整理了一下,供参考. ...