我需要使按钮在 :active 状态下看起来平坦。
比方说,例如,我有:
button {
background:linear-gradient(#fc9, #ed8) /* some light orange gradient */
}
button:hover {
background:linear-gradient(#ed8, #da7) /* some darker orange gradient on hover */
}
button:active {
background:orange; /* And here I need just plane flat orange color */
}
<button>Click Me!</button>
但不是这样,我从以前的状态得到了梯度。
是否有任何背景 CSS 属性可以关闭该渐变?
例如
blackground:liner-gradient-OFF; or background:no-inherit;
最佳答案
你真正需要的是:
button:active {
background-image: none;
background-color:orange;
}
关于css - 如何删除 :active state? 上的渐变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13238923/