有人知道为什么吗?
这是 JS:
$(".screenshots .tab1").hover(function() {
$(".section1").addClass("test");
}, function() {
$(".section1").removeClass("test");
});
});
还有 CSS:
.test {
background: black;
border: 1px solid #ffb75b;
background-color: #fffadb;
}
最佳答案
也许有一个 css 条目否决了你的条目。试试这个:
background-color: #fffadb !important;
关于javascript - addClass ("test") 不起作用 - 但 css ("background","red") 起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3563261/