<!--[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。
<!--[if lt IE 9]>
加载CSS1
<!--[else]>
加载CSS2
<![endif]-->
这样有效是有效,但是用HTML VALIDATOR里,报错,因为这个不符合XHTML 1.1的规范,
如果把ELSE语句去掉,则正确.
方法1:
加载CSS2
<!--[if lt IE 9]>
加载CSS1(可以把要重写的写在这里).
<![endif]-->
分享到:
相关推荐
--[if lt IE 6]>这是版小于6的Internet Explorer< ![endif]--> <!--[if lte IE 5.5]>这是Internet Explorer 5.5或更低< ![endif]-->注意两个特殊的语法: gt: 大于 lte: 小于或等于 !IE 感叹号的使用
IE8及以下完美支持video/audio且兼容所有浏览器的解决方案, IE条件注释,浏览器自动判断,在IE9以下...--[if lt IE 9]> <script src="http://api.html5media.info/1.1.4/html5media.min.js"></script> <![endif]-->
IE7.js 使IE5、IE6升级至兼容...注释使Internet Explorer版本号小于8的IE浏览器载入该代码,而其它符合标准的浏览器则会忽略该代码,并在IE8出来后不干扰其工作。 <!–[if lt IE 8]> [removed][removed] <![endif]–>
IE条件注释是一种特殊的HTML注释,这种注释只有IE5.0及以上版本才能理解。比如普通的HTML注释是: <!–This is a comment–> 而只有IE可读的IE条件注释是: <!–[if IE]> <![endif]–> “非IE条件注释...
条件注释能被IE判断是什么版本的浏览器,并在符合条件的情况下显示其中的内容,从IE5.0到7.0都支持注释功能,而且版本号精确到小数点后4位: 程序代码 <!–[if IE 6.1000]>此内容只有IE6.1可见<![endif]–> ...
– Comment content –> , IE 对HTML注释做了一些扩展,使之可以支持条件判断表达式: <!–[if expression]> HTML <![endif]–> 当表达式expression 为True 的时候,显示 HTML 内容。 例子: 代码如下:<!...
由于浏览器版本的不同,对CSS里某些元素的解释也不一样,针对浏览器版本不同而选择不同CSS的代码,其实我们还可以利用条件注释的方法来达到类似的目的,什么是条件注释,在此简单介绍一下,无非就是一些if判断啦,...
--[if IE]> <link rel=stylesheet type=text/css href=all-ie-only.css /> <![endif]--> 但是如果是IE10以上时,这个办法就不是很适用了。 IE10或IE11: 使用媒体查询(-ms-high-contrast)来加载样式表...
important 可被FireFox和IE7识别 * 可被IE6、IE7识别 _ 可被IE6识别 *+ 可被IE7识别 IE专用的条件注释 <!–其他浏览器 –> <link rel="stylesheet" type="text/css" href="css.css" /> <!–[if IE 7]> &...
–[if lte IE 6]> 这段文字仅显示在 IE6及IE6以下版本。 <![endif]–> <!–[if gte IE 6]> 这段文字仅显示在 IE6及IE6以上版本。 <![endif]–> <!–[if gt IE 6]> 这段文字仅显示在 IE6以上版本(不包含...
见得最多的就是检测navigator.userAgent(这个可以面向所有浏览器,略过)。 另外一种就是IE的条件注释,这篇有个比较详细的说明 //... 基于IE的条件注释,变种版本就有几种, 第一、类似下面的形式:
--[if IE]><link rel="stylesheet" type="text/css" href="ie.css" /><![endif]--> 这应该是我最常用的方法了,一般情况下,我们现在已经不用考虑IE5或者以下的浏览器了,这个注释让我们可以轻松HACK IE...
让IE(包括IE6)支持HTML5元素,我们需要在HTML头部添加以下JavaScript,这...–[if IE]> [removed][removed] <![endif]–> 上面这段代码仅会在IE浏览器下运行,还有一点需要注意,在页面中调用html5.js文件必须添加
总评支持 IE5.5 作为 IE6 版本,因为它们完全相同IE10 和 ulterior 不再支持条件注释( ),它将被视为ClassIE 的常规浏览器安装您可以选择缩小的库或使用以下命令安装它: jam install pyrsmk-classiebower install...
16位数字 :0-9和a-f 2.尺寸属性 1.作用 改变元素的宽度和高度 2.语法 width:宽度 取值:px % min-width:最小宽度 max-width:最大宽度 height:高度 取值:px % min-height:最小高度 max-height:最大高度...
1.7.2 使用<noscript>和</noscript>标记对给出提示信息 1.8 JavaScript的实现基础 1.8.1 ECMAScript 1.8.2 DOM 1.8.3 BOM 1.9 客户端与服务器端脚本 1.10 JavaScript与JScript、 VBScript 1.11 JavaScript与Java、...
(4) 关系运算(<、>、<=、>=、==、!=) 6 (5) 等性运算符(==、===、!=、!==) 6 (6) 条件运算符 7 (7) 其他运算符 7 赋值运算符 7 逗号运算符 7 typeof运算符 7 delete运算符 7 instanceof运算符 7 4. ...