Skip to content

Home

Flexbox centering

Horizontally and vertically centers a child element within a parent element using flexbox.

<div class="flexbox-centering">
  <div>Centered content.</div>
</div>
.flexbox-centering {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
}

More like this

Start typing a keyphrase to see matching snippets.