css實現圓角div

原理:


效果圖:


代碼:

<html>
<head>
<title>圓角div</title>
<style type="text/css">
#all
{
  width:600px;
  height:200px;
}
b
{
display:block;
margin:0 auto;
overflow:hidden;
border-left:1px solid red;
border-right:1px solid red;
height:1px;
background:yellow;
}
.b1,.b10
{
width:590px;
background:red;
}
.b2,.b9
{
width:592px;
}
.b3,.b8
{
width:594px;
}
.b4,.b7
{
width:596px;
}
.b5,.b6
{
width:598px;
}
.div1
{
  width:598px;
  height:190px;
  border-left:1px solid red;
  border-right:1px solid red;
  background:yellow;
}
</style>
</head>

<body>
<div id="all">
<b class="b1"></b>
<b class="b2"></b>
<b class="b3"></b>
<b class="b4"></b>
<b class="b5"></b>
<div class="div1"></div>
<b class="b6"></b>
<b class="b7"></b>
<b class="b8"></b>
<b class="b9"></b>
<b class="b10"></b>
</div>
</body>

</html>


發佈了55 篇原創文章 · 獲贊 102 · 訪問量 13萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章