Centering with Flexbox

Example

Formatting with a flexbox

CSS

.centerme {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: red;
    color: white;
    font-size: 2rem;
    text-transform: uppercase;
    height: 200px;
}


HTML


<div class="centerme">Formatting with a flexbox</div>