I want to highlight an input by applying an overlay to the whole page and giving the input relative position and Z index higher than the overlay.
.overlay {
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.4);
}
.is-highlighted {
position:relative;
z-index:2;
}
Something like the following:
It all works well until I give the white card an animation. Then, the fixed overlay only lays over the card, not the whole page:
Here's a fiddle showing the case: https://jsfiddle.net/ys5jot5s/1/
Commenting out the animation makes the overlay position itself correctly.
How can I make the overlay fill up the whole page? Alternatively I have tried to throw the overlay outside of the card, but then I can't seem to make the input pop in front of it.