I’m trying to overwrite a button background, which is:
background: url("path/to/image.jpg") no-repeat scroll left center transparent;
I want to get rid of the image, but as I cannot access the file, I need to overwrite via CSS or Jquery.
Any idea how I can do this, since something easy like background: none doesn’t work, I cannot use Jquery to remove the whole class and I don’t want to put in a transparent 1x1px png and waste an HTTP request. The image has to go… any idea what I can do?
Thanks for help.
Background is a compound property, you can target just the image by
background-image: none. More info on the property from MDN and W3C.Be advised that browser support for this may vary – I’ve done a quick Google search and it seems that IE and Safari may have issues with this.
To target this property in vanilla JS, you’d use camel case: