JSFiddle - React, Tailwind, and code Playground
HTML
<div class="d-tb">
<div class="d-tr">
<div class="d-td">
aa<div id="main">a</div>
</div>
<div class="d-td">
aa
</div>
</div>
</div>
CSS
body,html {
height: 100%;
}
.d-tb {
display: table;
position: relative;
width: 100%;
height: 100%;
}
.d-td {
display: table-cell;
vertical-align: middle;
position: relative;
width: 50%;
border: 1px solid black;
}
.d-tr {
display: table-row;
position: relative;
}
#main {
width: 100%;
height: 100%;
position: absolute;
top: 0;
opacity: 0.5;
bottom: 0;
z-index: 100;
background: red;
}