The transparency setting must be set through the CSS property opacity.
An obvious idea is to "cover" a black block and set the overlay to translucent black...
But if you reverse your thinking, you can think of: setting the image to be translucent, and then setting the container of the image to a solid black background, is not only simpler in structure, but also can degrade smoothly when transparency fails.
a. -webkit-filter (image brightness processing)
b. -webkit-mask (transparent layer)
If I remember correctly, all of the above methods can be achieved. Compatible low-level browsers generally use the first two.
The transparency setting must be set through the CSS property
opacity
.An obvious idea is to "cover" a black block and set the overlay to translucent black...
But if you reverse your thinking, you can think of: setting the image to be translucent, and then setting the container of the image to a solid black background, is not only simpler in structure, but also can degrade smoothly when transparency fails.