css - 在多个背景中隐藏其中一张背景图片

标签 css background-image

我有这样的事情:

background: url("photo.png") no-repeat scroll center 23px/ 42px 48px,
    url("DeleteAtt.png") no-repeat scroll 81px 3px / 20px 20px #656565;

而且在某些情况下我需要隐藏第二个背景, 我该怎么做?

最佳答案

您可以将背景属性重新定义为:

background: url("photo.png") no-repeat scroll center 23px/ 42px 48px #656565;

或者创建一个新类并在您的元素上添加或删除此类。

关于css - 在多个背景中隐藏其中一张背景图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17550724/

相关文章:

jquery - outerHeight() 和内部图片

javascript - 基本 jquery 步骤向导

html - 背景覆盖整个屏幕

CSS 媒体正文背景图片不可见

html - 只模糊背景中的重复图像?

css - 在 Twitter Bootstrap 的导航栏下方启动背景图片

jquery - 使元素在其父元素中居中

jquery - 除第 1 段外的所有段落环绕 Div

html - iframe 仅显示特定部分

html - 背景图像适合带有引导列的 div 宽度和高度 - PARALLAX