gpt4 book ai didi

css - 忽略 :hover in a specific class

转载 作者:太空宇宙 更新时间:2023-11-03 23:47:40 25 4
gpt4 key购买 nike

演示 http://jsfiddle.net/8cTRL/

如何使 b 类的对象在悬停时不会变黄?我知道我会写

.a:hover.b { background-color:green }

但我尽量不重复自己。 CSS是

.a:hover {
background-color:yellow
}
.b {
background-color:green
}

最佳答案

或者你可以试试这个:

.a:hover {
background-color:yellow
}

.a.b {
background-color:green
}

关于css - 忽略 :hover in a specific class,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21166714/

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