Published: April 17, 2024
You can now use the align-content
property from CSS Box Alignment
on block and table layouts. This will allow block direction alignment without
needing to create a flex or grid layout.
Browser Support
The once impossible task of centering an item vertically was made easier by flexbox and grid,
along with the align-content
property. However, it did involve creating a
flex or grid layout for no other reason than to do this alignment.
The property was specified for block layout, and in the past few months all
three major engines have shipped the feature.
With align-content
available for block layout, you can achieve
vertical alignment without needing to create a flex or grid layout for the property to
work. No additional properties are needed as the item remains a block item, the
only change is to the alignment.