<分区>
<分区>
请有人指导我如何将线性渐变 css 边框制作成圆形而不是方形,这将支持所有浏览器?按钮背景颜色也最好是透明的。
.btn_outter {
border: 2px solid;
border-image-source: linear-gradient(45deg, #FFF000, #000000);
border-image-slice: 1;
color: #000;
}
最佳答案
你可以试试下面的例子
<!DOCTYPE html>
<html>
<head>
<style>
.btn_outter {
border: 20px solid;
border-image-source: radial-gradient(red, green, blue);
border-image-slice: 20;
color: #000;
}
.round_div{
border: 1px solid;
width: max-content;
border-radius: 30px;
overflow: hidden;
}
</style>
</head>
<body>
<div class="round_div">
<button class="btn_outter"> button </button>
</div>
<p><strong>Note:</strong> Internet Explorer 9 and earlier versions do not support gradients.</p>
</body>
</html>
关于css - 如何为按钮而不是方形制作圆形渐变边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56303557/