JSFiddle - React, Tailwind, and code Playground
HTML
<div><div></div></div>
CSS
div {
width: 50%;
height: 100px;
margin: 10px;
border: 1px solid red;
position: relative;
z-index: 1;
}
div > div {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
border-color: cyan;
width: auto;
height: auto;
margin: auto;
}