Is there a way to hide the background image in CSS without removing it? For convenience, I'm using CSS to change whether or not it is displayed, and relying on a class to make it show. So, by default, it would be hidden, but the class would make it show. Because of this, the background image cannot be altered. What background properties can I use to achieve this? Changing the size to "0 0" actually made it 1px in the top left corner - not completely hidden. CSS3 solutions are accepted.
Select the picture that you want to remove the background from. Under Picture Tools, on the Format tab, in the Adjust group, select Remove Background.
You can use the max-height property to specify the maximum height of the image, and then use overflow: hidden; to hide anything else.
Option 1: Pure CSS [Limited Support]By putting the blend mode to screen you can remove the white background of your png image.
Just met the same problem. I use:
background-size: 0 0;
I think it's a little bit friendlier than using some huuuuge negative values for background-position
.
You could try positioning the background image outside of the viewable area, like setting
background-position: -9999px -9999px
or something less drastic depending on the viewable area.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With