css打造圆角边框,兼容各浏览器
<!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">
#content{ width:304px; border:0 solid #A93298; border-width:0 1px; padding:10px; }
/*#content{ width:300px; padding:10px; }*/
.xtop,.xbottom{ display:block; font-size:1px;background: transparent;}
.xb1,.xb2,.xb3,.xb4{ display:block; font-size:1px;}
.xb1{ margin:0px 5px; background:#A93298; height:1px;width:316px;}
.xb2{ margin:0px 3px; border:1px solid #A93298; border-width:2px; height:1px; border-top:none; border-bottom:none; width:316px;}
.xb3{ margin:0 2px; border:0 solid #A93298; border-width:0 1px; height:1px; width:320px;}
.xb4{ margin:0 1px; border:0 solid #A93298; border-width:0 1px; height:2px; width:322px;}
</style>
</head>
<body>
<div style="margin-top:30px; margin-left:30px;" >
<b class="xtop">
<b class="xb1"></b>
<b class="xb2"></b>
<b class="xb3"></b>
<b class="xb4"></b>
</b>
<div id="content">
某日,教授带着一班学生到实验室,指着一个装满尿的烧杯说:“
要想做一个好的生物学家,既要有勇敢的精神,又要有敏锐的观察力。
你们像我一样试一试。”说着,教授把手指伸进尿液,然后放到口中尝一尝。同学们
见到教授带了头,便硬着头皮尝试着。结果是丑态百出。
这时,教授笑道:“你们真是勇敢有余,观察不足。你们没注意,我伸进烧杯的是食指,放入
口中的是中指吧!”
</div>
<b class="xbottom">
<b class="xb4"></b>
<b class="xb3"></b>
<b class="xb2"></b>
<b class="xb1"></b>
</b>
</div>
</body>
</html>
原理就是用线,设置其高度和宽度

浙公网安备 33010602011771号