-1

I am trying to darken the background image of my websites body. I have set the background size to 'cover'

body {
background-image: url(assets/content-images/hero.jpg);
background-size: cover;
color:'darken'
}

this doesnt seem to work?

Mo Miah
  • 183
  • 2
  • 12

1 Answers1

-1

Any styling applied to the whole background for example a color will not change the shade of the background image.

There is one trick using gradients which works quite well but it is important to have a fallback color in case of browser incompatibility, and also to make sure the text is in a contrast that will be visible over the fallback color.

Courtesy of:

How to add a color overlay to a background image?

lanpierre
  • 97
  • 8