删除背景图像的CSS或jQuery(最好是CSS)。使用css/jquery隐藏较小的背景图像
我有一种情况,我不能使用CSS设置背景图像。
我在这里阅读所有类似的问题在stackoverflow但我找不到解决方案。
HTML
<div class="foo" style="background-image:url(http://example.com/gallery/albums/foo.jpg);">
</div>
CSS
.foo{
width 400px;
height:300px;
}
@media screen and (max-width: 200px) {
.foo{
background-image: none;
}
}
的jsfiddle Here
最后的手段:'background-image:none!important;' –
@ Karl-AndréGagnon就是这样,解决问题。谢谢。 – Puni