I'm setting up a popup modal with a open button inside a parent div, but when it opens, it is contained inside the div, and I want it to open on top of all the divs.
I've tried setting the z-index higher than the parent div, but it doesn't seem to make a difference. I suspect it has something to do with the placement of the parent div, which is positioned absolute middle and center inside its own parent div. If I take the modal out of the divs, it opens in full screen like I need it to.
<div id="parent1" style="position:relative;height:100%;z-index:1;">
<div id="parent2" style="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;width:100%;z-index:2;">
(modal, which is set to z-index:3)
</div>
</div>