Developer & Designer from Poland. I like to make things and share what I learn along the way.
Follow me on 🐦 Twitter for more: twitter.com/HadrysMateusz
That's because using multiple background layers doesn't modify other layers, it just stacks them on top of each other.
To get a semi-transparent image background, we need to use another element (or pseudo element as was suggested above) with an image background and an opacity lower than 1, and position it under another element using position: absolute.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What about a gradient?
background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5) ), url("bg.png");
This would create a half-transparent black overlay over an image.
The result looks like this
That's because using multiple background layers doesn't modify other layers, it just stacks them on top of each other.
To get a semi-transparent image background, we need to use another element (or pseudo element as was suggested above) with an image background and an
opacity
lower than1
, and position it under another element usingposition: absolute
.