.wrapper { align-items: center; border: solid 1px black; display: flex; flex-direction: column; height: 150px; justify-content: center; } h1, h2 { margin: 0; }