JSFiddle - React, Tailwind, and code Playground
HTML
<div class="t1">
<div class="t2"></div>
</div>
CSS
.t1 {
background: rgba(0,0,0,0.2);
width: 500px;
height: 500px;
position: relative;
}
.t2 {
background: rgba(255,0,0,1);
width: 300px;
height: 300px;
margin: auto;
}