I have a div in which there is an a tag.
I gave opacity:0.5 to the div then the text inside opacity is also 0.5
I don’t want to use background image, then how can I have a text with opacity:1 inside my div with opacity:0.5 ??
I have a div in which there is an a tag. I gave opacity:0.5
Share
Set the background color of the parent using rgba (includes alpha transparency). Example:
This sets the opacity of the background of the container when using colors, however it does not set the opacity of the children. If you need to do that, set the opacity of the children to whatever you’d like with another class:
If you want to use a background-image, just set the opacity on the image itself (use a PNG).