align-self

W3C CSS Snapshot 2026

Override the container’s cross-axis alignment for one item.

On this page

Syntax and values

Value or syntaxWhat it does
autoThe initial value. Uses the container’s align-items value in normal flex layout.
normal / stretchStretches the auto-sized item in flex layout.
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 aligned item’s own writing direction.
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-self 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 { height: 140px; align-items: center; gap: 6px; }
.layout .second { align-self: flex-end; }
  </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 B aligns at the bottom while A and C stay centered. Change B to auto to use the shared alignment.

Official references