<div class="g-container">
    <div class="g-box"></div>
</div>
.g-container {
    width: 100vw;
    height: 100vh;
    
    display: flex;
    // display: grid;
    // display: inline-flex;
    // display: inline-grid;
}

.g-box {
    width: 40vmin;
    height: 40vmin;
    background: #000;
    
    margin: auto;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.