orsubexpressionto reverse the Boolean meaning of the expres
一、做页面开发时我们根基城市需要解决的问题:
1、解决ie9以下浏览器对 html5新增标签的不识别,并导致CSS不起感化的问题。
2、让不撑持css3 Media Query的浏览器 包孕IE6-IE8等其他浏览器撑持盘问。
由于IE6/IE7/IE8还有很大一部分用户,为了让网站浏览者都能正常的访谒HTML5网站,故这两种问题还是需要解决的,
二、解决方案很简单:在head标签里添加如下代码就行了:
<!--[if lt IE 9]> <script src="http://www.mamicode.com/https:/cdn.staticfile.org/html5shiv/r29/html5.min.js"></script> <script src="http://www.mamicode.com/https:/cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script> <![endif]-->
以上代码是一个注释,感化是在 IE 浏览器的版本小于 IE9 时将读取 以下 .js 文件,并解析它。
注意:国内用户请使用国内相对不变资源库(Google 资源库在国内不不变)
有的项目客户现场必建都是内网环境,外网引入,还是不行的。最简单的要领,,还是把这两个文件下载下来,放到本身本地了。
下载地点:respond.min.js / respond.js下载
html5shiv.min.js / html5shiv.js下载
三、代码说明:
以下等等都是IE专门供给的一种语法,只有IE能识别运行,其他浏览器只会作为注解。
<!--[if !IE]> 除IE外都可识别 <![endif]--> <!--[if IE]> 所有的IE可识别 <![endif]--> <!--[if IE 6]> 仅IE6可识别 <![endif]--> <!--[if lt IE 6]> IE6以及IE6以下版本可识别 <![endif]--> <!--[if gte IE 6]> IE6以及IE6以上版本可识别 <![endif]--> <!--[if IE 7]> 仅IE7可识别 <![endif]--> <!--[if lt IE 7]> IE7以及IE7以下版本可识别 <![endif]--> <!--[if gte IE 7]> IE7以及IE7以上版本可识别 <![endif]--> <!--[if IE 8]> 仅IE8可识别 <![endif]--> <!--[if IE 9]> 仅IE9可识别 <![endif]-->
项目典型说明! [if !IE] The NOT operator. This is placed immediately in front of the feature, operator, or subexpression to reverse the Boolean meaning of the expression.
NOT运算符。这是摆当即在前面的成果,操纵员,或子表达式扭转布尔表达式的意义。
lt [if lt IE 5.5] The less-than operator. Returns true if the first argument is less than the second argument.
小于运算符。如果第一个参数小于第二个参数,则返回true。
lte [if lte IE 6] The less-than or equal operator. Returns true if the first argument is less than or equal to the second argument.
小于或即是运算。如果第一个参数是小于或即是第二个参数,则返回true。
gt [if gt IE 5] The greater-than operator. Returns true if the first argument is greater than the second argument.
大于运算符。如果第一个参数大于第二个参数,则返回true。
gte [if gte IE 7] The greater-than or equal operator. Returns true if the first argument is greater than or equal to the second argument.
大于或即是运算。如果第一个参数是大于或即是第二个参数,则返回true。
( ) [if !(IE 7)] Subexpression operators. Used in conjunction with boolean operators to create more complex expressions.
子表达式运营商。在与布尔运算符用于创建更庞大的表达式。
& [if (gt IE 5)&(lt IE 7)] The AND operator. Returns true if all subexpressions evaluate to true
AND运算符。如果所有的子表达式计算功效为true,返回true
| [if (IE 6)|(IE 7)] The OR operator. Returns true if any of the subexpressions evaluates to true.
OR运算符。返回true,如果子表达式计算功效为true。
html5shiv.js 说明: 解决ie9以下浏览器对html5新增标签的不识别,并导致CSS不起感化的问题。
respond.min.js说明: 让不撑持css3 Media Query的浏览器包孕IE6-IE8等其他浏览器撑持盘问。
上面解决方案里用的两个JS文件地点,网上也有很多。不想用这个的可以本身再找一下另外cdn地点。
这里可以查到bootstrap的 其他CDN地点
但愿可以辅佐到你。
by不言谢。
html5shiv.js 和 respond.min.js 的感化与说明。
温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/30981.html