align-items

W3C CSS Snapshot 2026

Set the default cross-axis alignment for the items in each flex line.

On this page

Syntax and values

Value or syntaxWhat it does
normalInitial value or initial settings for this property.
normal / stretchIn flex layout auto-sized items stretch across the line, within their minimum and maximum sizes.
start / endAligns to the logical start or end of the relevant axis.
flex-start / flex-endFollows the start or end of the flex axis. Reverse directions can change which edge this is.
centerCenters the items or lines along the relevant axis.
self-start / self-endUses the item’s own writing direction to choose its aligned edge.
baseline / first baseline / last baselineAligns first or last text baselines. baseline is the first-baseline form.
safe center / unsafe centerThe safe modifier falls back to start when centering would cause overflow. Unsafe keeps the requested alignment. These modifiers apply to supported positional values.

Try the example

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>align-items example</title>
  <style>
.layout { display: flex; width: min(100%, 320px); border: 2px solid teal; box-sizing: border-box; }
.layout > div { padding: 8px 12px; background: #def5f5; color: #123; border: 1px solid #81b9b5; box-sizing: border-box; }
.layout { min-height: 130px; gap: 6px; align-items: center; }
  </style>
</head>
<body>
<div class="layout">
  <div class="first">A</div>
  <div class="second">B</div>
  <div>C</div>
</div>
</body>
</html>

What to expect The three tiles sit at the vertical center of this row. Try stretch to fill the row height.

Official references