鍍金池/ 問答/HTML/ 遮罩漸變按鈕

遮罩漸變按鈕

圖片描述
這種按鈕如何使用CSS來實現(xiàn)?

回答
編輯回答
放開她

代碼/效果截圖如下,兼容性未做。建議直接圖片代替這種按鈕。

<div class="button">確認(rèn)</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;
}

圖片描述

2017年2月22日 09:50
編輯回答
撿肥皂

建議圖片,最簡單,能兼容

2018年7月25日 18:43