Let's say I have
<div class="myDiv">Hi there</div>
I want to put a background-image
and give it an opacity
of 0.5
– but I want that the text I have written will have full opacity (1
).
If I would write the CSS like this
.myDiv { opacity:0.5 }
everything will be in low opacity – and I don't want that.
So my question is – How can I get low-opacity background image with full opacity text?
So here is an other way:
background-image: linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.5)), url("your_image.png");