因为边框渐变和圆角冲突 设置了边框的渐变色属性 border-radius属性就会失效
所以要在外面包一层div 给div设置渐变 里面的按钮设置圆角
.stopFastParent {
width: 80px;
height: 24px;
box-sizing: border-box;
padding: 2px;//边框线的宽度
border-radius: 12px;
background-image: linear-gradient(0deg, #6bf0ca, #d2f681) !important;//边框线的渐变色
margin: 0 auto;
}
.stopFast {
width: 100%;
height: 100%;
border-radius: 12px;
background: #1f1c31 !important;// 如果是空心 可和背景色同色 如果是实心就正常写背景色
}
这里是html布局
<div className={stopFastParent}>
<Button className={stopFast} >按钮</Button>
</div>