【发布时间】:2019-04-25 08:42:20
【问题描述】:
我正在设置此按钮转换,但我发现我用于网络中其他按钮的效果不适用于此按钮。 边框颜色在过渡时反转。
我必须使用渐变背景,所以不能改变它。
#button {
background: linear-gradient(#FFF,#FFF) padding-box, linear-gradient(to right, blue 0%, green 100%) border-box;
border: 3px solid transparent;
color: #000;
background-color: white;
border-radius: 25px;
margin-top: 60px;
margin-bottom: 0px;
font-weight: 600;
font-size: 14px;
padding: 7px 22px;
transition: all .5s ease;
margin-left: auto;
margin-right: auto;
display: block;
}
#button:hover{
background: linear-gradient(to right, blue 0%, green 100%);
border: 3px solid transparent;
color: #FFF;
transition: all .5s ease;
transition-property: all;
transition-duration: 0.5s;
transition-timing-function: ease;
transition-delay: 0s;
}
<button id="button"> BUTTON </button>
【问题讨论】:
-
能否请您提供您的 html 代码 - 您可以简单地创建一个 sn-p,以便您可以看到您之前的进度:)
标签: css border transition gradient