纯css圆角
时间:2011-06-06 来源:红色曼陀罗
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
#containter{margin:0px 30%;
background-color:#ccc;
}
b.rtop,b.rbottom{
display:block; background:#fff;}
b.rtop b,b.rbottom b{display:block; overflow:hidden; background-color:#ccc;}
b.r1{margin:0 5px;}
b.r2{margin:0 3px;}
b.r3{margin:0 2px;}
b.r4{margin:0 1px; }
h2,p{
padding:10px;
}
h2{
text-align:center;
}
</style>
</head>
<body>
<div id="containter">
<b class="rtop">
<b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b>
</b>
<h2>这是标题</h2>
<p>这里是圆角的内容</p>
<b class="rbottom">
<b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b>
</b>
</div>
</body>
</html>
原理: