button的边框如何渐变加圆角?
网友回复
社区技术运营专员-CJiang:
https://developer.mozilla.org/zh-CN/docs/Web/CSS/border-radius
曹孟良:
这个方案可以实现,看的懂不,为了清晰点,我把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;