两种圆角的实现方式和原理
原理:就是在一个层上加二到三个层,不过这些层只有左右边线,最上和最下有背景色,然后它们都有长度差距,就这样了,
<html
<head>
<title>无标题页</title>
<style>
.up1
{
overflow:hidden;
height:1px;
margin-left:4px;
margin-right:4px;
background-color: Aqua;
border-left:solid 1px Aqua;
border-right:solid 1px Aqua;
}
.up2
{
overflow:hidden;
height:1px;
margin-left:3px;
margin-right:3px;
border-left:solid 1px Aqua;
border-right:solid 1px Aqua;
}
.up3
{
overflow:hidden;
height:1px;
margin-left:2px;
margin-right:2px;
border-left:solid 1px Aqua;
border-right:solid 1px Aqua;
}
.content
{
margin-left:1px;
margin-right:1px;
height:100px;/*这里控件高度*/
/*background-color: Aqua;*/
border-left:solid 1px Aqua;
border-right:solid 1px Aqua;
}
.down1
{
overflow:hidden;
height:1px;
margin-left:2px;
margin-right:2px;
border-left:solid 1px Aqua;
border-right:solid 1px Aqua;
}
.down2
{
overflow:hidden;
height:1px;
margin-left:3px;
margin-right:3px;
border-left:solid 1px Aqua;
border-right:solid 1px Aqua;
}
.down3
{
overflow:hidden;
height:1px;
margin-left:4px;
margin-right:4px;
background-color: Aqua;
border-left:solid 1px Aqua;
border-right:solid 1px Aqua;
}
.cell
{
width: 50px;/*这里控制宽度*/
}
div.RoundedCorner{background: #9BD1FA}
b.rtop, b.rbottom{display:block;background: #FFFFFF}
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="cell">
<div class="up1">
</div>
<div class="up2">
</div>
<div class="up3">
</div>
<div class="content">
这里放内容
</div>
<div class="down1">
</div>
<div class="down2">
</div>
<div class="down3">
</div>
</div>
<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>