开发者社区> geovindu> 正文

Css:Conditional comments(条件注释)

简介: http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx http://www.quirksmode.org/css/condcom.html Item Example Comment ! [if !IE] The NOT operator. This is placed immediately in front of
+关注继续查看

http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx

http://www.quirksmode.org/css/condcom.html

Item Example Comment
! [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.
lt [if lt IE 5.5] The less-than operator. Returns true if the first argument is less than the second argument.
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.
gt [if gt IE 5] The greater-than operator. Returns true if the first argument is greater than the second argument.
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.
( ) [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
| [if (IE 6)|(IE 7)] The OR operator. Returns true if any of the subexpressions evaluates to true

 

<!--[if IE]><p>You are using Internet Explorer.</p><![endif]-->
<![if !IE]><p>You are not using Internet Explorer.</p><![endif]>

<!--[if IE 7]><p>Welcome to Internet Explorer 7!</p><![endif]-->
<!--[if !(IE 7)]><p>You are not using version 7.</p><![endif]-->

<!--[if gte IE 7]><p>You are using IE 7 or greater.</p><![endif]-->
<!--[if (IE 5)]><p>You are using IE 5 (any version).</p><![endif]-->
<!--[if (gte IE 5.5)&(lt IE 7)]><p>You are using IE 5.5 or IE 6.</p><![endif]-->
<!--[if lt IE 5.5]><p>Please upgrade your version of Internet Explorer.</p><![endif]-->

<!--[if true]>You are using an <em>uplevel</em> browser.<![endif]-->
<![if false]>You are using a <em>downlevel</em> browser.<![endif]>

<!--[if true]><![if IE 7]><p>This nested comment is displayed in IE 7.</p><![endif]><![endif]-->


 

<!--[if gte IE 7]>
<SCRIPT LANGUAGE="javascript">
alert("Congratulations! You are running Internet Explorer 7 or a later version of Internet Explorer.");
</SCRIPT>
<P>Thank you for closing the message box.</P>
<![endif]-->


 

 

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
开源炫酷css轮播图 可直接引入html文件使用 含注释 jQuery插件
开源炫酷css轮播图 可直接引入html文件使用 含注释 jQuery插件
20 0
开源超美css动态背景 可直接引入html文件使用 含注释、可更改
开源超美css动态背景 可直接引入html文件使用 含注释、可更改
33 0
零基础CSS入门教程(18)——注释
我们可以看到在代码里面加注释,在网页上面是显示不出来的,我们要学会使用注释,并且养成使用注释的习惯。我们之前学习html的注释,不止是html有注释css也有注释。注释再我们英语和文言文里面很常见。/* 设置背景颜色和字体颜色 */
15 0
html+css实战8-注释
html+css实战8-注释
35 0
JavaWeb学习之路(32)–CSS之注释
本文目录 1. 前言 2. CSS注释的格式 3. 小结
81 0
html,css,javascript注释
是HTML的注释标签,使用 < 和 > 是符合HTML标签语法规则的。 /* */是CSS的注释标签 /* */(注释代码块)、//(注释单行)是JS的注释标签。
702 0
css - 移动端reset汇总与注释
1.解决移动端触摸a元素,会有蓝色阴影 正常状态:         点击时状态:   a{ outline:none; -webkit-tap-highlight-color: rgba(0,0,0,0); } -webkit-tap-highlight-color: rgba(0,0,0,0);可以将该阴影透明化   2.
913 0
idea 自动生成JAVA Js Css类和方法注释代码
idea 自动生成JAVA Js Css类和方法注释代码 Setting-->Editor-->Live Templates 类注释 /** * Title: $className$.
1181 0
css:注释格式不当引起背景色无效
这两天试着写CSS,被一个问题烦得够呛。问题源码如下:/*   全局*/body {MARGIN: 0px;PADDING:0px;background:#4c4c4c;}本来这个应该没有问题,但是在IE6上浏览时背景显示为白色,在FF上则正常。
629 0
+关注
geovindu
读者是,读之者,者之读.一沙一世界! to be is to do举世皆清我独浊,众人皆醒我独醉.俺是农民工,程序员.
文章
问答
文章排行榜
最热
最新
相关电子书
更多
零基础CSS入门教程
立即下载
低代码开发师(初级)实战教程
立即下载
阿里巴巴DevOps 最佳实践手册
立即下载