html52.com
我爱小程序-开发者交流社区

button的边框如何渐变加圆角?

button的边框如何渐变加圆角?

网友回复

曹孟良:

这个方案可以实现,看的懂不,为了清晰点,我把css都写在标签里面了。就是在button外面套一个渐变背景的view,然后边框宽度就是外层view的宽高减去内层button的宽高。圆角border-radious在view和button里都要写。亲测有效的

  <view style="width: 305rpx;height: 305rpx; border-radius: 50rpx; background: linear-gradient(to right, red , yellow);" >
    <button style="width: 300rpx;height: 300rpx; background: white; border-radius: 50rpx;">点我</button>
  </view>
      :

直接清除自带的,自己重新写

微喵网络:

来个代码片段

,,,:

目前可以实现边框渐变,但是不能圆角目前可以实现边框渐变,但是不能圆角

xplee:
  -moz-border-radius:0.3em; 
  -webkit-border-radius:0.3em; 
  border-radius:0.3em;

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付