In Photoshop if you import a JPG image with a white background into a document with a blue background
, you can make the white background
of the image disappear by setting the image to “multiply” mode.
Can I do exactly the same thing with CSS alone?
3
Answers
In CSS you can use
mix-blend-mode
Snippet
Or you can use
background-blend-mode
Snippet
IE doesn’t support both, see Support here and here
You can use background-blend-mode but only in Chrome and Firefox.
According to the CSS Tricks article, the code looks like this:
Yes…sort of…
The question is a little vague but can we remove the white ‘part’ of an image and let us see the background color of the element behind it?
Yes we can…with
mix-blend-mode
.Note: this is only showing that background of the element behind the div holding the image….nothing happens if you add a background color to the wrapping div.
For that you might need yet another wrapper.
or perhaps as a background to a pseudo-element: