JSFiddle - React, Tailwind, and code Playground

HTML

<div></div>

CSS

div {
        width: 90%;
        margin-left: -45%; /* negative value of element's width/2 */
        margin-top: -45%; /* negative value of element's height/2 */
        height: 90%;
        position: absolute;
        top: 50%; /* must always be 50% */
        left: 50%; /* must always be 50% */
        border: 1px solid;
    }