-2

I'm creating a header where the background-image is dark while the other images on the header are bright. How do I make the background-image dark without dark the other images in the header?

Paulie_D
  • 107,962
  • 13
  • 142
  • 161
Ilya
  • 1

2 Answers2

0

As @Paulie_D wrote, you can't really. But I suggest you simply duplicate and edit the original image file (making it darker) and use that version as your background image.

Johannes
  • 64,305
  • 18
  • 73
  • 130
0

This is the method I have been using for a while.

body {
  position: relative;
  width: 100%;
  height: 100VH;
  background: url(http://fc02.deviantart.net/fs71/i/2011/274/6/f/ocean__sky__stars__and_you_by_muddymelly-d4bg1ub.png);
}

body::before {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .4);
  content: '';
}
Joykal Infotech
  • 1,840
  • 3
  • 9
  • 17