我在更新部分网站的背景颜色时遇到了很大的困难。
我想做的是简单地更改 .container
id 为 #footer
的 div,
但是我写的所有规则都不起作用!
#footer.container{ background-color:#4C555A !important; }
或
#footer{ background-color:#4C555A !important; }
我什至尝试通过 jQuery 来做到这一点
$( "#footer.container" ).css("background-color","yellow");
$( "#footer" ).css("background-color","yellow");
但它们都不起作用!
你能看看This Link吗?让我知道我在这里遗漏了什么或做错了什么? 谢谢
最佳答案
我想你想更改“.footer-new”div:
.footer-new {
height: 250px;
background-color: #4C555A !important;
}
或者使用 jQuery:
$( "#footer.container" ).css("background-color","#4C555A");
这是你需要的吗?
关于jquery - 无法定位并将新的 CSS 规则应用于 Div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26189712/