JSFiddle - React, Tailwind, and code Playground
by Alex Coleman
HTML
<div class="father">
<div class="son">box1</div>
</div>
CSS
div.father {
border: 1px solid black;
align-items: center;
justify-content: center;
display: flex;
height: 300px;
width: 300px;
left: 50%;
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
}
div.son {
border: 1px solid black;
height: 100px;
width: 100px;
align-items: center;
justify-content: center;
display: flex;
}