DIV CORNER 圆角实现

实现原理:

根据像素原理,把边角的几个像素颜色调成背景色。

代码如下:
<style type="text/css">
div#coner{ margin: 0 10%;background: #964689}

b.top, b.bottom{display:block;background: #FFF}
b.top b, b.bottom b{display:block;height: 1px;
    overflow: hidden; background: #964689}
b.line1{margin: 0 5px}
b.line2{margin: 0 3px}
b.line3{margin: 0 2px}
b.line4{margin: 0 1px}

</style>
<div id="coner">
<b class="top">
 <b class="line1"></b><b class="line2"></b><b class="line3"></b><b class="line4"></b>
</b>
hello</br>hello world
<b class="bottom">
 <b class="line4"></b><b class="line3"></b><b class="line2"></b><b class="line1"></b>
</b>
</div>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值