- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I am using css to set the opacity of a div for the first time. The div has a background color of black. The opacity is working fine and is doing exactly what I want it to do. My problem is that I didn’t realize that it would also make the contents of the div have the same opacity. I tried to put the contents in a new div and set the opacity lower, but it don’t seem to work. I am trying to put white text in the box but the text is coming out brown because of the opacity setting on the parent div. Anyone know how to get around this issue?
basically you make two divs with the same dimensions, then place the text in one of them and the effect in the other, after this use z-index so that the effect div is pushed below the text div and hey presto!
Use rgba for the background color
thanks for the link. I will check it out.
and once again I learned something new!