CSS UtilitiesAlign Items

Align Items

These utility classes control how flex and grid items line up across the container’s cross axis, which is the axis perpendicular to the one its children flow along. Reach for them any time the default alignment of a cluster, stack, flank, split, or grid doesn’t match what you’re after: centering icons next to text, making all cards in a row share the same height, or pinning form labels to the top of each row.

Class Namealign-items ValuePreview
cs-align-items-baselinebaseline
cs-align-items-centercenter
cs-align-items-endflex-end
cs-align-items-startflex-start
cs-align-items-stretchstretch

Override with Align Self

When you need a flex or grid item to deviate from the align-items property of its container, use the cs-align-self-* classes to set the item’s align-self property and individually change its alignment on the container’s cross axis.

Class Namealign-self ValuePreview
cs-align-self-centercenter
cs-align-self-baselinebaseline
cs-align-self-endflex-end
cs-align-self-startflex-start
cs-align-self-stretchstretch

What’s the Cross Axis?

The cross axis runs perpendicular to a container’s content direction. For containers where flex-direction is row and content flows in the inline direction, the cross axis runs in the block direction. For containers where flex-direction is column and content flows in the block direction, the cross axis runs in the inline direction.