I'm trying to make an overlap form div (blue) by activity-indicator div (yellow). Both containers should fill all available spaces of parent div, but yellow one (activity indicator) should overlap blue one (input form). I've tried to use position: absolute
for activity div, but then I'm loosing parent width and height. What I'm doing wrong and how can it be fixed?
html,
body {
width: 100vw;
height: 100vh;
margin: 0;
background-color: aquamarine;
display: flex;
align-items: center;
justify-content: center;
}
.root-wrapper {
width: 300pt;
height: 440pt;
display: flex;
flex-direction: column;
background-color: gray;
}
.logo {
height: 80pt;
background-color: green;
}
.content-container {
display: flex;
flex-direction: column;
flex: 1 1 auto;
background-color: lightcoral;
padding: 20pt;
box-sizing: border-box;
position: relative;
z-index: 1;
}
.input-form {
position: relative;
flex: 1 1 auto;
background-color: rgb(60, 109, 173);
z-index: 2;
}
.activity-indicator {
position: relative;
flex: 1 1 auto;
background-color: yellow;
z-index: 9;
}
<div class="root-wrapper">
<div class="logo"> </div>
<div class="content-container">
<div class="activity-indicator">
</div>
<div class="input-form">
</div>
</div>