Z-index must be related to body, but the element position must be related to nearest parent

I have the following DOM element on my application: <body> … <!– ELEMENT 1 –> <div class=”position-absolute” style=”z-index: 10;”> CONTENT </div> <!– ELEMENT 2 –> <div class=”position-absolute” style=”z-index: 5;”> <!– ELEMENT 3 –> <button class=”btn btn-md btn-outline-info”>Action</button> <!– ELEMENT 4 –> <div class=”position-absolute” style=”top: 1px; left: -50px;”> DROPDOWN MENU </div> </div> … </body> I need…

Details