align-items

Defines the default behavior for how items are aligned along the cross axis (perpendicular to the main axis) in a flex or grid container.

.container {
  display: flex;
  align-items: center;
  /* centers items vertically in a row container */
}
Initial value
normal
Inherited
No
Applies to
allElements
Animation type
discrete

Values

normalstretchanchor-center
Widely available Since 2015 96% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.

Safe to use without fallbacks.

29+
20+
9+
12+
ESC