CSS finally adds vertical centering in 2024
September 3, 2024
The status quo for CSS alignment is to switch to flexbox or grid because align-content doesn’t work in the default layout (flow). In 2024, browsers have implemented align-content for flow layout. This has some advantages:
You do not need flexbox or grid, just 1 CSS property for alignment.
Therefore, the content doesn’t need to be wrapped in a div.
Source: CSS finally adds vertical centering in 2024 | Blog | build-your-own.org
At first I thought this was a little overstates–we’ve bee able to do this for ages with flex–turns out we no longer need flex! align-content works with normal flow now.