JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container">
<div class="a">a</div>
<div class="b">b</div>
</div>
CSS
div {
display: flex;
flex-direction: column;
opacity: 0.9;
margin: 10px;
}
.container {
background: black;
height: 200px;
}
.a {
position: absolute;
width: 100px;
height: 100px;
background: red;
flex: auto;
}
.b {
background: blue;
opacity: 0.5;
flex: auto;
}