相容所有瀏覽器的圓角矩形效果代碼執行個體,

來源:互聯網
上載者:User

相容所有瀏覽器的圓角矩形效果代碼執行個體,

相容所有瀏覽器的圓角矩形效果代碼執行個體:
CSS3中已經給出了非常方便定義圓角的屬性,可惜IE瀏覽器中相容性很差,這裡就不多介紹了,具體可以參閱CSS3實現圓角效果一章節。由於相容性問題所以要使用一些特別的方法來實現圓角效果,下面就是一段這樣的代碼執行個體。
代碼如下:

<!DOCTYPE html><html><head><meta charset=" utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>div+CSS圓角矩形</title><style type="text/CSS">body{  padding:20px;  background-color:#FFF;  font:100.01% "Trebuchet MS",Verdana, Arial,sans-serif}div#nifty{  margin:0 10%;  background:#9BD1FA}p{padding:10px}div.rtop, div.rbottom{  display:block;  background:#FFF}div.rtop div, div.rbottom div{  display:block;  height:1px;  overflow:hidden;  background:#9BD1FA}div.r1{margin: 0 5px}div.r2{margin: 0 3px}div.r3{margin: 0 2px}div.rtop div.r4, div.rbottom div.r4{  margin:0 1px;  height:2px}</style></head><body><div id="nifty">  <div class="rtop">    <div class="r1"></div>    <div class="r2"></div>    <div class="r3"></div>    <div class="r4"></div>  </div>  <p>螞蟻部落歡迎您!</p>  <div class="rtop">    <div class="r4"></div>    <div class="r3"></div>    <div class="r2"></div>    <div class="r1"></div>  </div></div></body></hmtl>

以上代碼雖然較為麻煩一些,但是能夠實現圓角效果,還是挺不錯的。

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=9521

更多內容可以參閱:http://www.softwhy.com/divcss/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.