gpt4 book ai didi

css - 如何删除 :active state? 上的渐变

转载 作者:行者123 更新时间:2023-12-04 16:24:41 27 4
gpt4 key购买 nike

我需要使按钮在 :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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com