原理:
效果圖:
代碼:
<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>