CSS制作圆角边框

转自: http://blog.onlygrape.com/css-arc/362

 

一直做圆角的边框都是用图片来铺成的,这次尝试了下用CSS来制作圆角的边框,效果还是蛮不错的。

代码如下:

<style type="text/css">

.arcaround {width:100%; height:auto;}
.arc, .abottom {display:block; background:transparent; font-size:1px;}
.xb1, .xb2, .xb3, .xb4 {display:block; overflow:hidden;}
.xb1, .xb2, .xb3 {height:1px;}
.xb2, .xb3, .xb4 {background:#ccc; border-left:1px solid #08c; border-right:1px solid #08c;}
.xb1 {margin:0 5px; background:#08c;}
.xb2 {margin:0 3px; border-width:0 2px;}
.xb3 {margin:0 2px;}
.xb4 {height:2px; margin:0 1px;}

.acontent {display:block; background:#ccc; height:20px; border:0 solid #08c; border-width:0 1px;}

</style>

<div class="arcaround">
<class="arc"><class="xb1"></b><class="xb2"></b><class="xb3"></b><class="xb4"></b></b>
<div class="acontent"></div>
<class="abottom"><class="xb4"></b><class="xb3"></b><class="xb2"></b><class="xb1"></b></b>
</div>


效果如图:


 

posted on 2009-07-29 12:12  炜升  阅读(364)  评论(0编辑  收藏  举报