隐藏多个背景中的背景图像之一

时间:2013-07-09 14:21:05

标签: css3 background-image

我有这样的事情:

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

我需要在某些情况下隐藏第二个背景, 我怎么能这样做?

感谢

3 个答案:

答案 0 :(得分:0)

我猜想你可以通过改变第二张图像的背景位置来做到这一点。

background-position: center 23px, 9999px 3px;

这些方面的东西。

答案 1 :(得分:0)

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

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

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

答案 2 :(得分:0)

为要隐藏的图像指定背景大小为 0。

例如ioutil.ReadAll(r)