How to make a background image darker ?
Can anybody help me ?
5 Replies
Easiest way is to set a layer a background image with a gradient (from and to the same color if you want it uniform):
though honestly, an even better way is to just make the image darker with an image editor
thank you sir 🥺
is :after {} on top of the image a viable solution too ? (or is it bad practice ?)
an
::after
with a transparent background color or gradient would work too. The plus to that would be not having to deal with the multiple background layers that can sometime be confusing. The negative is having to set up the pseudo, the z-index
related stuff and probably apointer-event:none;
to make sure you don't effect text selecting.You could use background blend mode:
background: rgba(0, 0, 0, .65) url('<your url>');
background-blend-mode: darken;