October 10, 2024
Vertical centering with CSS

I just read on the website of James Smith that align-content works in the default layout in 2024. This allows vertical centering with 1 CSS property.

<div style="align-content: center; height: 100px;">
  align-content just works!
</div>
  align-content just works!

Supported since: Chrome: 123 | Firefox: 125 | Safari: 17.4

()  Joost van der Schee

next blog post next post previous blog post previous post Scroll to top