积累与应用 - 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]-->

posted @ 2015-03-24 10:06  Vincent的web小站  阅读(119)  评论(0编辑  收藏  举报