当前位置: 移动技术网 > IT编程>网页制作>CSS > HTML中的Hack条件注释语句

HTML中的Hack条件注释语句

2019年03月10日  | 移动技术网IT编程  | 我要评论
ie 条件注释判断语句是 ie 特有的功能,通过 html 注释中的条件语句能让不同的 ie 版本识别注释中的内容

自ie10起,标准模式不再支持条件注释
条件注释语句中可以是html、css也可以是javascript,空格和大写不要写错

1.只能被 ie 识别
  <!--[if ie]>
   只能被 ie 识别;
  <![endif]-->

2.ie6
  <!--[if ie 6]>
   这是ie6
  <![endif]-->

3.ie7
  <!--[if ie 7]>
  这是ie7
  <![endif]-->
4.ie8
  <!--[if ie 8]>
  这是ie8
  <![endif]-->
5.ie9
  <!--[if ie 9]>
    这是ie9
  <![endif]-->
6.高于ie6
  <!--[if gt ie 6]>
  这是大于ie6
  <![endif]-->
也可以有下面这几种写法
<!--
gt(reater than) 大于
gte(greater than or equal)大于等于
lt(less than) 小于
lte(less than or equal) 小于等于
! 非
-->

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网