积累与应用 - html

积累与应用 - html

1.判断IE版本并使用不同的样式表

  语法:<!--[if 判断符 IE的版本号] <link rel="stylesheet" href="A.css" /> <![endif]-->  

  判断符: lt - 小于  gt - 大于 lte - 小于等于 gte - 大于等于

  IE版本号:IE 6(5.5000|7|8|9|10)

 

  所有的IE都起作用:<!--[if IE]> <link rel="stylesheet" type="text/css" href="all-ie-only.css/> <![endif]-->

  IE以外的浏览器起作用:<!--[if !IE]><!--> <link rel="stylesheet" type="text/css" href="not-ie.css" /> <!--<![endif]-->

  只有IE7起作用:<!--[if IE 7]> <link rel="stylesheet" type="text/css" href="ie7.css"> <![endif]-->

  只有IE6起作用:<!--[if IE 6]> <link rel="stylesheet" type="text/css" href="ie6.css"/> <![endif]-->

  只有IE5起作用:<!--[if IE 5]> <link rel="stylesheet" type="text/css" href="ie5.css"/> <![endif]-->

  只有IE5.5起作用:<!--[if IE 5.5000]> <link rel="stylesheet" type="text/css" href="ie55.css"/> <![endif]-->

  只对IE6及以下的版本起作用:

    <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="ie6-and-down.css"/> <![endif]-->

    <!--[if lte IE 6]> <link rel="stylesheet" type="text/css" href="ie6-and-down.css"/> <![endif]-->

  只对IE7及以下的版本起作用:

    <!--[if lt IE 8]> <link rel="stylesheet" type="text/css" href="ie7-and-down.css"/> <![endif]-->

    <!--[if lte IE 7]> <link rel="stylesheet" type="text/css" href="ie7-and-down.css"/> <![endif]-->

  只对IE8及以下的版本起作用:

    <!--[if lt IE 9]> <link rel="stylesheet" type="text/css" href="ie8-and-down.css"/> <![endif]-->

    <!--[if lte IE 8]> <link rel="stylesheet" type="text/css" href="ie8-and-down.css"/> <![endif]-->

  只对IE6及以上的版本起作用:

    <!--[if gt IE 5.5]> <link rel="stylesheet" type="text/css" href="ie6-and-up.css"/> <![endif]-->

    <!--[if gte IE 6]> <link rel="stylesheet" type="text/css" href="ie6-and-up.css"/> <![endif]-->

  只对IE7及以上的版本起作用:

    <!--[if gt IE 6]> <link rel="stylesheet" type="text/css" href="ie7-and-up.css"/> <![endif]-->

    <!--[if gte IE 7]> <link rel="stylesheet" type="text/css" href="ie7-and-up.css"/> <![endif]-->

  只对IE8及以上的版本起作用:

    <!--[if gt IE 7]> <link rel="stylesheet" type="text/css" href="ie8-and-up.css"/> <![endif]-->

    <!--[if gte IE 8]> <link rel="stylesheet" type="text/css" href="ie8-and-up.css"/> <![endif]-->

转载于:https://www.cnblogs.com/vincentXblog/p/4361961.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值