I have a div in which there are some things, and the user has the option to click "x" to say "This does not apply to me," for example.
Instead of deleting a div, I want to play a translucent div on top of it.
I started with some complicated javascript to determine the size and location of my div in the question, and create a new one on top of it. The script was giving size and location that looked about the same as on my eye, but the div overlap was put in the wrong place.
Then I realized that there is a (possibly) much easier way to do this.
I put a div with a dimming class inside the div that I want to disable. The blackout css class has visibility set to hidden, so javascript will set it to visible when necessary.
The problem I am facing is that even with this method I canβt get it to exactly fill the rectangle that has the parent div.
I had
.blackout { position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; background-color: black; opacity: 0.5; filter: alpha(opacity = 50); }
This filled the entire screen, not just the parent div.
What do I need to change to fill only the parent div?
Ozzah source share