div.horizontal { display: flex; justify-content: center; } div.vertical { display: flex; flex-direction: column; justify-content: center; }