IE8下圓角的展現,解決IE8下圓角沒法顯示的問題,ie8及其如下版本兼容性問題之圓角

前兩天遇到一個在瀏覽器圓角展現按鈕的設計,在IE8下遇到了難點,IE8下按鈕變成了方塊形狀。css

  VS html

一頓百度後找到了方案,採用ie-css3.htc的方式能夠解決IE8下圓角功能。css3

下載地址: http://fetchak.com/ie-css3/web

具體代碼:瀏覽器

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=EDGE">
    <title>圓角展現</title>
    <style>
        .circle{
            background-color: #349CD3;
            -moz-border-radius: 61px; 
            -webkit-border-radius: 61px; 
            border-radius: 61px;
            height: 120px;
            width: 120px;
            behavior: url(ie-css3.htc);
        }
    </style>
        
  </head>
  <body>
        <div class="circle"></div>
  </body>
</html>

效果以下:fetch

VSui

 

 

備註:url

ie-css3的使用方法很簡單,在樣式里加入behavior: url(ie-css3.htc文件的路徑);就能夠了(括號裏是ie-css3.htc的地址,千萬別寫錯了)spa

ie-css3.htc不單單能夠用來解決圓角問題,還能夠解決陰影效果,有興趣的能夠試試看。設計

相關文章
相關標籤/搜索