Tutorials

CSS 'align-items' Property Explained

  • Published
  • 2 min read
  • CSS
  • HTML
  • Web Design
CSS 'align-items' Property
In this article
  1. CSS 'align-items' Property Examples
  2. Browser Support For 'align-items' Property
  3. CSS Syntax of the 'align-items' Property
  4. Usage of the 'align-items' Property
  5. Property Values of the 'align-items' Property

Corrected . Align-items initial value is normal and alignment is described by axis rather than as vertical (checked against MDN). The browser-support table was also rebuilt from MDN browser-compat-data. Editorial approval is still pending.

The CSS 'align-items' property is a key player in Flexbox and Grid layouts, providing a way to align child elements (items) within their container. In flexbox it aligns items on the cross axis, which runs up and down in a horizontal writing mode when flex-direction is row, but runs left to right when flex-direction is column. In grid layout it aligns items on the block axis within their grid areas. It is especially noticeable when the items do not all have the same size along that axis.

CSS 'align-items' Property Examples

See the Pen CSS 'align-items' Property by Webzstore (@webzstore) on CodePen.

The Pen above is an external example. Baseline alignment (align-items: baseline) lines items up by the baseline of their content, which is particularly noticeable when text sizes differ.

Browser Support For 'align-items' Property

Unprefixed support for the align-items property (selected supported implementation, desktop browsers)
BrowserVersionReleased
Chrome29Aug 2013
Edge12Jul 2015
Firefox20Apr 2013
Safari9Sep 2015
Opera16Aug 2013

Source: MDN browser-compat-data 8.1.4, checked 3 October 2026. Prefixed support and implementations that were later removed are not counted, and some browsers list partial support or extra values. See the MDN reference for align-items for the full compatibility details, including mobile browsers.

CSS Syntax of the 'align-items' Property

align-items: normal | stretch | flex-start | flex-end | start | end | center | baseline | initial | inherit;

Usage of the 'align-items' Property

You'd use 'align-items' to control the alignment of items along the cross axis of a flex container (or along the block axis for grid items in a grid container). In a typical row-direction flex container in a horizontal writing mode, that means vertical alignment; with flex-direction: column the cross axis is horizontal, and a vertical writing mode changes the physical directions again. The property is useful for consistent alignment among items that vary in size or to match a specific design requirement.

Property Values of the 'align-items' Property

  • Normal: The initial value. Its behaviour depends on the layout: in a flex container it behaves as stretch; in a grid container it behaves like stretch, except for items that have an aspect ratio or intrinsic size, which behave as start.
  • Stretch: Items that have an automatic size on the cross axis (for example height: auto in a row flex container) are stretched to fill the container's cross size, within their min and max size limits.
  • Flex-start: (Flexbox only) Items are aligned to the cross-start edge of the flex container.
  • Flex-end: (Flexbox only) Items are aligned to the cross-end edge of the flex container.
  • Start and End: Items are aligned to the start or end edge of their alignment container, following the writing mode.
  • Center: Items are centered on the cross axis (block axis in grid).
  • Baseline: Items are aligned based on their baseline.
  • Initial: Sets this property to its initial value, normal.
  • Inherit: Inherits this property from its parent element.

Share this article

Written by

Webzstore Team

Webzstore has helped businesses since 2010. Today, we bring websites, digital marketing and enquiry follow-up into practical plans built around the work each business needs.

Related services

Talk about your website or marketing

Book a Free 30-Minute Call

More tutorials

All tutorials

Privacy choices

Choose what this website may load. Your choice is saved on this device for up to 180 days. Privacy Policy

Turning a choice off stops further use of that optional service on this site. It does not take back information already sent, and we cannot delete cookies that other services set in your browser.