当前位置:编程学习 > 网站相关 >>

个人整理的CSS hack

测试环境:ietester IE9 firefox chrome

  case:  首位 background:属性  末尾
  经过测试
  末尾 属性值:\9     支持:IE所有版本
  末尾 属性值:\0     支持:IE8 IE9
  末尾 属性值:\0\9     支持:IE8 IE9
  首位 属性值:*     支持:IE6 IE7
  首位 属性值:+     支持:IE6 IE7
  首位 属性值:*+     支持:IE6 IE7
  首位 属性值:_    支持:IE6
  首位 属性值:-   支持:IE6
  
  注意事项:IE6对所有“单标签”(指的是+ - : 等等标签)都能正常显示其属性。
 IE9属于标准的浏览器了,所以无需使用hack        

附上代码:
[html]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html lang="en"> 
<head> 
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 
    <title></title> 
    <style type="text/css"> 
        .test{ 
            background:#ccc; 
            :background:red;/*IE6也支持*/ 
            height:200px; 
            width:200px; 
        } 
    </style> 
</head> 
<body> 
    <div class="test"> 
         test  
    </div> 
    <font color=red> 
        测试环境:ietester  IE9 firefox chrome 
    </font> 
    <pre> 
        case:  首位 background:属性  末尾 
        经过测试 
        末尾 属性值:\9           支持:IE所有版本 
        末尾 属性值:\0           支持:IE8 IE9 
        末尾 属性值:\0\9     <span style="white-space:pre">    </span>支持:IE8 IE9 
        首位 属性值:*        支持:IE6 IE7 
        首位 属性值:+        支持:IE6 IE7 
        首位 属性值:*+           支持:IE6 IE7 
        首位 属性值:_            支持:IE6 
        首位 属性值:-            支持:IE6 
         
        注意事项:IE6对所有“单标签”(指的是+ - : 等等标签)都能正常显示其属性 
         
         
    </pre> 
</body> 
</html> 

 

摘自 私房菜馆

补充:Web开发 , 其他 ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,