标题 | html条件注释判断浏览器版本命令总结 |
范文 | pse: collapse; font: 14px/24px 'trebuchet ms', helvetica, 'microsoft yahei', georgia, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(68,68,68); word-spacing: 0px; -webkit-text-size-adjust: none; -webkit-text-stroke-width: 0px border=1 width=100%> 项目 范例 说明 ! [if !ie] not运算符。这是摆立即在前面的功能,操作员,或子表达式扭转布尔表达式的意义。 lt [if lt ie 5.5] 小于运算符。如果第一个参数小于第二个参数,则返回true。 lte [if lte ie 6] 小于或等于运算。如果第一个参数是小于或等于第二个参数,则返回true。 gt [if gt ie 5] 大于运算符。如果第一个参数大于第二个参数,则返回true。 gte [if gte ie 7] 大于或等于运算。如果第一个参数是大于或等于第二个参数,则返回true。 ( ) [if !(ie 7)] 子表达式运营商。在与布尔运算符用于创建更复杂的表达式。 & [if (gt ie 5)&(lt ie 7)] and运算符。如果所有的子表达式计算结果为true,返回true。 | [if (ie 6)|(ie 7)](!--> 除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 lt ie 9]> 加载css1 <!--[else]> 加载css2 <![endif]--> 注:这样有效是有效,但是用html validator里,报错,因为这个不符合xhtml 1.1的规范, 如果把else语句去掉,则正确. 上述问题解决方案一: 加载css2 <!--[if lt ie 9]> 加载css1(可以把要重写的写在这里). <![endif]--> |
随便看 |
|
在线学习网范文大全提供好词好句、学习总结、工作总结、演讲稿等写作素材及范文模板,是学习及工作的有利工具。