I need to provide this image with css. A layer must be placed on the image. I can’t get exactly the same appearance. Is there a solution to this? It can also be an SVG filter.
I’ve tried it, but I can’t make it.
div {
width: 400px;
height: 800px;
background-image: url("https://i.stack.imgur.com/z5W7Q.jpg");
background-color: rgba(16, 24, 45, 0.8);
background-size: contain;
background-repeat: no-repeat;
background-blend-mode: darken;
}
<div></div>
2
Answers
I had solved this problem much later. I'd better add it here. Related answer.
Set the image on a pseudo-element (
::before
) under thediv
(z-index: -1
), and use thegrayscale
filer to convert it to black & white.Set the semi-transparent background color (
rgba(16, 24, 45, 0.8)
) on thediv
.