您的位置:首页 > Web前端 > CSS

css实现圆角div

2012-09-27 22:17 543 查看
原理:



效果图:




代码:

<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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: