JSFiddle - React, Tailwind, and code Playground
HTML
<div class="parent">
<div class="centered">centered</div>
</div>
CSS
.parent {
position: relative;
width: 200px;
height: 200px;
background: #D2E7F2;
margin: 20px;
}
.centered {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100px;
height: 20px;
margin: auto;
background: #FF8040;
}