Search code examples
cssbackground-image

Hide one of background images in multiple background


I have such a thing:

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

and I need to hide the second background in some situations, how can I do it?


Solution

  • You can redefine background property to:

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

    Or create a new class and add or remove this class on your element.