css - Set opacity of background image without affecting child elements - Stack Overflow

PHOTO EMBED

Fri Jul 29 2022 08:45:03 GMT+0000 (Coordinated Universal Time)

Saved by @pycajiqutu #css

div {
  width: 300px;
  height: 200px;
  background: linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.5)), url("https://i.imgur.com/xnh5x47.jpg");
}
span {
  background: black;
  color: white;
}
content_copyCOPY

https://stackoverflow.com/questions/4997493/set-opacity-of-background-image-without-affecting-child-elements