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.

It is documented as part of the CSS Box Alignment, CSS Flexible Box Layout specification.

/* Usage Example */
.container {
  display: flex;
  align-items: center;
  /* centers items vertically in a row container */
}

/* Syntax */
align-items: normal;
align-items: stretch;
align-items: anchor-center;

/* Global values */
align-items: inherit;
align-items: initial;
align-items: revert;
align-items: revert-layer;
align-items: unset;
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.

29+
20+
9+
12+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC