小知识锦集

条件注释判断IE浏览器版本兼容

2018-02-27  本文已影响0人  沃土前端社区_子鸣
IE浏览器制定版本进入注释
<!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]-->
<!--[if IE]> 所有的IE可识别 <![endif]-->
<!--[if IE 6]> 仅IE6可识别 <![endif]-->
<!--[if gt IE 6]> IE6以及IE6以上版本可识别 <![endif]-->
<!--[if gte IE 6]> IE6以及IE6以上版本可识别 <![endif]-->
<!--[if lt IE 7]> IE7以下版本可识别 <![endif]-->
<!--[if lte IE 7]> IE7以及IE7以下版本可识别 <![endif]-->
<!--[if IE 8]> 仅IE8可识别 <![endif]-->
解释
  • !非运算符!IE即除了IE
  • lt IE 7 小于运算符,IE7以下版本可识别,即 &lt 转移字符 <
  • gt 大于运算符,&gt转义大于
  • lte 小于或等于
  • gte 大于或等于
上一篇 下一篇

猜你喜欢

热点阅读