代码/效果截图如下,兼容性未做。建议直接图片代替这种按钮。 <div class="button">确认</div> .button { position: relative; width: 120px; height: 30px; color: #1e9cd8; border-radius: 16px; font-size: 18px; text-align: center; border: 4px solid transparent; background: #ffff; background-clip: padding-box; } .button::after { position: absolute; top: -4px; bottom: -4px; left: -4px; right: -4px; content: ''; background: linear-gradient(90deg, #0379c2, #22dff3); z-index: -1; border-radius: 16px; }
代码/效果截图如下,兼容性未做。建议直接图片代替这种按钮。