I have a div which has a background of:
background: linear-gradient(120deg, #6971a2 0%, white 80%);
I'd like to add opacity functionality to this background whilst not affecting the text inside the div.
I'm aware of RGBA. However, I'm fairly sure linear-gradient cannot be used with it?
Thanks!
You may use any CSS <color>
as a stop on a a linear-gradient
, including #hexa
and rgba()
which allow you to gradate between opacities.
The transparency of an element’s background (or its background gradient) will have no effect on its content.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments