css圆角渐进增强体现方式一

24 篇文章 0 订阅
19 篇文章 0 订阅

              目前除了IE678浏览器,其他浏览器对css3的圆角都支持的很给力,不得不承认很多前端工程师在圆角制作上面费了很多功夫,css3的圆角 border-radius属性方便了很多(是非常多),虽说有很多方法让ie678也支持css3里面圆角等简单属性,但个人觉得那样增加浏览器加载负担,而且处于发展阶段,在添加某些额外的属性后才恩那个正常使用,最近看到前端行业内对‘渐进增强’有很多讨论。于是最近也在圆角上面体现渐进增强(总不能等到html5,css3普及了再去使用吧,那样就玩完了)

              为了实现自增长圆角,务必将圆角图片设置长一点

              我的圆角图片  (500px*12px)高度为圆角高度的两倍

 我的css样式:

/*圆角*/
.radius_top_ie,.radius_bot_ie {height: 6px; padding-left:10px; position:relative; overflow:hidden; z-index:3}
.radius_top_ie,.radius_top_ie_in { background:url(../../images/hr/bg/tset.png) 0 0 no-repeat\9;}
.radius_bot_ie,.radius_bot_ie_in {background:url(../../images/hr/bg/tset.png) 0 -6px no-repeat\9;}
.radius_top_ie_in {height: 100%;background-position:100% 0;}
.radius_bot_ie_in {height: 100%;background-position:100% -6px;}
.radius_top_ie {margin-bottom:-6px;}
.radius_bot_ie {margin-top:-6px;}
 /*end_圆角*/

我的html实现:

<div style="width:200px; margin:90px;">
<!--[if lt IE 9]><div class="radius_top_ie"><div class="radius_top_ie_in"></div></div><![endif]-->
<div style="width:198px; height:200px; background:#f2f9ff; border:1px solid #5e92cc; border-radius:4px; "></div>
<!--[if lt IE 9]><div class="radius_bot_ie"><div class="radius_bot_ie_in"></div></div><![endif]-->
</div>

当IE处于IE9以下的版本时候采用html+css方式显示圆角, 其他则忽略相关代码直接用border-radius属性      

(注:若有错误请多多指教)                                                            

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值