How to make a background image darker ?

Can anybody help me ?
5 Replies
Jochem
Jochem•3w ago
Easiest way is to set a layer a background image with a gradient (from and to the same color if you want it uniform):
body {
background-image: linear-gradient(rgba(0 0 0 / 0.5), rgba(0 0 0 / 0.5) ), url("https://picsum.photos/1920/1080");
}
body {
background-image: linear-gradient(rgba(0 0 0 / 0.5), rgba(0 0 0 / 0.5) ), url("https://picsum.photos/1920/1080");
}
though honestly, an even better way is to just make the image darker with an image editor
i_lost_to_loba_kreygasm
thank you sir 🥺
Doksuri
Doksuri•3w ago
is :after {} on top of the image a viable solution too ? (or is it bad practice ?)
capt_uhu
capt_uhu•3w ago
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.
Sleep Twitch
Sleep Twitch•3w ago
You could use background blend mode: background: rgba(0, 0, 0, .65) url('<your url>'); background-blend-mode: darken;
Want results from more Discord servers?
Add your server