我收到一位客户的设计稿,其中的一个按钮有两层渐变色。麻烦的是,其中一层有弧形边缘。我制作了这个按钮的效果图,希望你能明白我的意思。
我所做的只有直线边缘(请参见代码段,颜色差异不重要,只需要曲线)。有人之前做过这个吗?或者必须使用背景图像?谢谢!
P.S. 我也考虑过在伪元素上使用径向渐变,并将其绝对定位,但无法获得与线性渐变相同的直线边缘外观。
a {
background-image: linear-gradient(-155deg,rgba(74,148,214,.4) 45%,rgba(255,255,255,.08) 15%),linear-gradient(258deg,rgba(87,238,255,.1),rgba(77,108,211,.2));
background-color: rgba(74,148,214,.9);
color: #fff;
width: 200px;
height: 40px;
border-radius: 10px;
margin-top: 50px;
display: block;
text-align: center;
line-height: 40px;
}
<a>
Some button
</a>