Trying to arrange 3 HTML elements on the z-plane:
.bank {
width: 200px;
height: 200px;
background-color: grey;
position: absolute;
z-index: 100;
transform: translateY(10%);
}
.card {
width: 100px;
height: 100px;
background-color: red;
position: absolute;
left: 50px;
top: 50px;
z-index: 300;
}
.button {
width: 50px;
height: 50px;
background-color: green;
position: absolute;
left: 30px;
top: 50px;
z-index: 200;
}
<div class="bank">
bank
<div class="card">card</div>
</div>
<div class="button">button</div>
Trouble getting the button behind the card while above the bank.
Edit: Found a workaround by removing z-index and transform from '.bank', but need the transform property. Any suggestions?
What could be causing the issue? Thanks