看了老大的部落格。總結一下學到的知識

來源:互聯網
上載者:User

今天看了老大的部落格。www.cnblogs.com/wmw1989

本來感覺如果不加入圖片不可能實現圓角效果,一共有三種方法,現在看懂了其中一種。總結如下:

源碼:

<html>
<head>
<title>css圓角效果</title>
<meta http-equiv="content-type" c>
<style type="text/css">
div.RoundedCorner{background: #9BD1FA}
b.rtop, b.rbottom{display:block;background: #FFF}
b.rtop b, b.rbottom b{display:block;height: 1px;overflow: hidden; background: #9BD1FA}
b.r1{margin: 0 5px}
b.r2{margin: 0 3px}
b.r3{margin: 0 2px}
b.rtop b.r4, b.rbottom b.r4{margin: 0 1px;height: 2px}
</style>
</head>
<body>
<div class="RoundedCorner">
<b class="rtop"><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></b>
<br>無圖片實現圓角框<br><br>
<b class="rbottom"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b></b>
</div>
</body>
</html>

總結下下:

本方法就是通過在上下邊際建立div來控制圓角的形成的

在頂部和底部分別建立幾個div,高度為一個像素。然後通過設定div的外邊距來形成圓角效果

外邊距右上及下逐次遞增。下外邊距至此遞減。然後圓角效果就呈現出來了。

 

 

外邊距知識小結:助記方法:四個參數是就是上順(從上開始,上右下左)三個時上  左右  下   兩個時 上下    左右   一個時 四方面

margin:10px 5px 15px 20px;

  • 上外邊距是 10px
  • 右外邊距是 5px
  • 下外邊距是 15px
  • 左外邊距是 20px
例子 2
margin:10px 5px 15px;
  • 上外邊距是 10px
  • 右外邊距和左外邊距是 5px
  • 下外邊距是 15px
例子 3
margin:10px 5px;
  • 上外邊距和下外邊距是 10px
  • 右外邊距和左外邊距是 5px

例子4

 

margin: 23px;上下左右外邊距均為23px

 

 

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.