浅析border-radius如何兼容IE


目前而言firefox,opera,chrome等主流浏览器都已经支持border-radius属性,唯独IE8以及之前。

解决办法就是在用的border-radius属性的后面加上:behavior: url(ie-css3.htc);

XML/HTML Code复制内容到剪贴板
  1. <!DOCTYPE html>  
  2. <html lang="en">  
  3. <head>  
  4.     <meta charset="UTF-8">  
  5.     <title>border-radius兼容IE</title>  
  6.     <style>  
  7.         .d1{   
  8.             width: 5em;   
  9.             height:5em;   
  10.             background: #e4393c;   
  11.             /*防止浏览器版本过低*/   
  12.             -moz-border-radius: 50%;   
  13.             -webkit-border-radius: 50%;   
  14.             border-radius: 50%;   
  15.             /*解决IE*/   
  16.             behavior: url(ie-css3.htc);   
  17.         }   
  18.     </style>  
  19. </head>  
  20. <body>  
  21.     <div class="d1"></div>  
  22. </body>  
  23. </html>  

以上这篇浅析border-radius如何兼容IE就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持phpstudy。


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3