JSFiddle - React, Tailwind, and code Playground
HTML
<div class="relative black blue">
<div class="relative">
<h1>sds</h1>
<h1>sdsds</h1>
<h1>sdsds</h1>
<h1>sdsds</h1>
<div class="block red absolute"></div>
</div>
</div>
CSS
.block {
width: 100px;
height: 100%;
}
.black {
background-color: black;
}
.red {
background-color: red;
}
.blue {
color: blue;
}
.relative {
position: relative;
width: auto;
padding: 10px;
}
.absolute {
position: absolute;
}
.block.red.absolute {
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: -1;
}
.relative.black.blue {
z-index: 0;
}