zoukankan      html  css  js  c++  java
  • IE条件注释判断

    相信大家都知道IE有专门的注释条件判断来引入一些css、js、html代码,但是语法有点拗口,记不住,下面我来做一下笔记:

    正常的html注释:
    <!--注释注释注释注释...-->
    
    注释条件判断
    IE7:
    <!--[if IE 7]>
    引入的任何css、js、html
    <![endif]-->
    
    IE7及以上:
    <!--[if gte IE 7]>
    引入的任何css、js、html
    <![endif]-->
    
    IE7及以下:
    <!--[if lte IE 7]>
    引入的任何css、js、html
    <![endif]-->
    
    IE7以上(不含IE7):
    <!--[if gt IE 7]>
    引入的任何css、js、html
    <![endif]-->
    
    IE7以下(不含IE7):
    <!--[if lt IE 7]>
    引入的任何css、js、html
    <![endif]-->
    
    IE7或IE8:
    <!--[if IE 7|IE 8]>
    引入的任何css、js、html
    <![endif]-->
    
    非IE7或IE8:
    <!--[if lt IE 7|gt IE 8]>
    引入的任何css、js、html
    <![endif]-->
    或者
    <!--[if !(IE 7|IE 8)]>
    引入的任何css、js、html
    <![endif]-->

    非IE的写法比较特殊:

    <!--[if !IE]>-->
       任何css、js、html
    <!--<![endif]-->

    IE判断的写法只兼容到IE9,到IE10已经是只显示非IE注释的内容了,所以我们现在习惯叫的IE浏览器其实多是指IE9及以下

  • 相关阅读:
    GNU安装
    camera链接
    右键terminal
    Angular cli 常见问题
    Angular路由复用策略RouteReuseStrategy
    angular5 websocket 服务
    promise 极简版封装
    js a 标签 通过download 实现下载功能
    angular6 升级到 angular7+ 最新Ng-zorro
    最新IDEA永久激活
  • 原文地址:https://www.cnblogs.com/amiezhang/p/8244019.html
Copyright © 2011-2022 走看看