JSFiddle - React, Tailwind, and code Playground

by jsdt

HTML

<div>
    <div class="parent">
        <div class="inner">

        </div>
    </div>
</div>

CSS

.parent{
        width: 60px; height: 60px;
        border: 1px solid palevioletred;
        position: relative;
    }
    .inner{
        background: palegreen;
        width: 40px; height: 40px;
        position: absolute; left: 50%; top: 50%;
        transform: translate(-50%, -50%);   
    }