HTML_head标签中META,IF IE 及 IFrame 中的页面的兼容性相关问题

meta中常用的标签:

‍<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><!-- 设置页面编码 -->
<meta http-equiv="Content-Language" content="zh-CN" /><!--设置页面语言 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /><!-- 强制使用IE7模式渲染 -->

<!-- 在IE使用时,强制使用当前IE浏览器的最新版本模式渲染,在非IE使用时,强制使用Chrome的模式渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
<meta http-equiv="Cache-Control" content="no-siteapp" /><!-- Baidu:禁止百度生成转码后的手机站 -->

<meta http-equiv="refresh" content="5;URL=http://www.baidu.com" /><!-- 5秒后自动刷新指向新页面 -->
<meta http-equiv="Cache-Control" content="no-cache" /><!-- 禁止浏览器从本地计算机的缓存中访问页面内容 -->
<meta name="keywords" content="keywords01,keywords02"><!-- 向搜索引擎说明你的网页的关键词 -->
<meta name="description" content="this is my web description."><!-- 告诉搜索引擎你的站点的主要内容 -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<!--Mobile:默认设备宽度,初始大小1,最大尺寸1,禁止缩放 --> 
<meta name="renderer" content="webkit" /><!-- 360:默认采用高速模式 -->

 IE 版本识别:

<!--[if IE]> 所有的IE可识别 <![endif]-->
<!--[if !IE]> 除IE外都可识别 <![endif]--> 
<!--[if IE 8]> 仅IE8可识别 <![endif]--> 
<!--[if lt IE 9]> IE9以下版本可识别 <![endif]--> 
<!--[if gt IE 6]> IE6以上版本可识别 <![endif]--> 
<!--[if lte IE 8]> IE8及IE8以下版本可识别 <![endif]--> 
<!--[if gte IE 9]> IE9及IE9以上版本可识别 <![endif]-->

 

IFrame渲染模式:

IFrame是直接使用被嵌入的网页的渲染模式,不受IFrame里的强制渲染模式所控制。

eg:

A网页通过Iframe嵌入了B网页,A网页使用了 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />,B网页使用了<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10" />,实际运行时,A,B网页都使用的IE7的模式进行渲染。

posted @ 2015-10-29 09:56  liguojun  阅读(5204)  评论(0编辑  收藏  举报