zoukankan      html  css  js  c++  java
  • 对于IE6及以下版本的处

    判断IE6 CSS 通过判断浏览器类型而加载不同的css样式

    所有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]-->

    三、通常对IE6做这样处理:
    (本站就是这样处理)
    对于IE6及以下版本处理是很具有挑战性.近来,人们都在呼吁对IE6要太在意,包括一些企业,一些网络应用,甚至是政府。现在有一个比让这些在 IE6下让人惨忍睹网站下地域更好解决方案,那就是单独写一个针对IE6精简CSS样式表,这样至少会影响人们浏览网页主要内容。然后再写一个IE6以上版本及其它浏览器正常CSS,这样是很好?

    <!--[if !IE 6]><!-->   <link rel="stylesheet" type="text/css" media="screen, projection" href="REGULAR-STYLESHEET.css" /> <!--<![endif]-->   <!--[if gte IE 7]>   <link rel="stylesheet" type="text/css" media="screen, projection" href="REGULAR-STYLESHEET.css" /> <![endif]-->   <!--[if lte IE 6]>   <link rel="stylesheet" type="text/css" media="screen, projection" href="http://universal-ie6-css.googlecode.com/files/ie6.0.3.css" /> <![endif]-->

    四、如果你非要用HACK来解决话……请往下看
    只对IE7起作用:

    * html #div {     height: 300px; }

    对非IE7起作用:

    #div {     _height: 300px; }

    只对IE6以上版本起作用:

    #div {    height/**/: 300px; }
    html->body #div {       height: 300px; }
    浪漫家园,没事就来逛逛
  • 相关阅读:
    [ASP.NET]c#利用WebClient和WebRequest类获得网页源代码
    远程重启、关闭电脑命令、远程重启计算机命令。
    SQL SERVER 2005转换为SQL2000数据库,生成脚本及导出数据全过程
    Winform,C#,listView判断鼠标点击是行还是listView的空白区
    前端MVC Vue2学习总结(八)——前端路由
    JavaSE学习总结(一)——Java基础
    开区间覆盖的约简
    流形上的微积分 习题 1.18
    王昆扬老师发来的材料:关于实数的构造
    连续函数注记
  • 原文地址:https://www.cnblogs.com/lovezbs/p/4430485.html
Copyright © 2011-2022 走看看