CSS align-self Property

Beginner
6 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The align-self property overrides align-items for one flex item or grid item. In a row flex, it moves that item up or down inside the line. The other items stay where the container put them.

Set it on the item, not on the container. The initial value is auto, which copies the parent's align-items. It is not inherited. To move every item the same way, use align-items. To pack extra lines, use align-content.

Standard-track.

Not deprecated. Flex and grid values are widely supported. It does not apply to block boxes or table cells. anchor-center is only for anchor-positioned boxes and needs a current browser.

CSS Syntax

syntax.css
align-self: auto | stretch | center | flex-start | flex-end | baseline | initial | inherit;

Property Values

ValueDescriptionTry it
autoDefault. Uses the container's align-items valueTry it
stretchThe item grows to the line's cross size when that size is autoTry it
centerCenters this item inside the lineTry it
flex-startPacks this item against the start of the cross axisTry it
flex-endPacks this item against the end of the cross axisTry it
baselineLines this item's text baseline up with other baseline itemsTry it
initialSets this property to its default value, autoTry it
inheritInherits this property from the parent elementTry it

How to Use align-self

Set the group with align-items. Override one item with align-self.

  1. Set display: flex or display: grid on the container.
  2. Give the line a cross size you can see. For a row flex, that is usually height.
  3. Set align-items on the container for the items that should match.
  4. Set align-self on the one item that should differ. A fixed height on that item blocks stretch.
PieceRequired?Role
Flex or grid itemYesThe element that receives align-self
align-items on the containerUsualThe group alignment that auto copies
Spare cross-axis spaceYes, to see itA row needs height. A column needs width
KeywordYesflex-end, center, stretch, or auto

Live Preview

The row uses align-items: flex-start. Only the blue item uses align-self.

One and Three stay at the top. Two is the item you move.

Items
One
Two
Three

align-self: flex-end

CSS Examples

Each snippet sets the group with align-items, then overrides one item. Use Try It Yourself for a live editor.

Example 1 — One Item at the End

Keep One and Three at the top. Send Two to the bottom.

CSS
<style>
  section {
    display: flex;
    align-items: flex-start;
    height: 120px;
    border: 1px solid #ccc;
  }
  div {
    height: 40px;
    border: 1px solid #999;
  }
  .pick {
    align-self: flex-end;
  }
</style>

<section>
  <div>One</div>
  <div class="pick">Two</div>
  <div>Three</div>
</section>
Try It Yourself

How It Works

  1. Make a row. display: flex lays the three items in one line.
  2. Park the group at the top. align-items: flex-start is the shared rule. One and Three follow it.
  3. Leave spare height. height: 120px is taller than the 40px items, so there is room to move.
  4. Override one item. align-self: flex-end on .pick sends only Two to the bottom.

Example 2 — Center One Item

The group stays at the top. Two sits in the vertical middle.

CSS
<style>
  section {
    display: flex;
    align-items: flex-start;
    height: 120px;
    border: 1px solid #ccc;
  }
  div {
    height: 40px;
    border: 1px solid #999;
  }
  .pick {
    align-self: center;
  }
</style>

<section>
  <div>One</div>
  <div class="pick">Two</div>
  <div>Three</div>
</section>
Try It Yourself

How It Works

  1. Same row. One, Two, and Three are flex items in a 120px box.
  2. The group starts at the top. align-items: flex-start places One and Three there.
  3. Center only Two. align-self: center uses the spare height above and below that one item.
  4. The others do not move. align-self never changes a sibling. On a grid item, the same keyword centers that item inside its grid area.

Example 3 — Stretch One Item

One and Three stay short. Two grows to the full height of the row.

CSS
<style>
  section {
    display: flex;
    align-items: flex-start;
    height: 120px;
    border: 1px solid #ccc;
  }
  div {
    height: 40px;
    border: 1px solid #999;
  }
  .pick {
    height: auto;
    align-self: stretch;
  }
</style>

<section>
  <div>One</div>
  <div class="pick">Two</div>
  <div>Three</div>
</section>
Try It Yourself

How It Works

  1. Short siblings. height: 40px on div keeps One and Three from filling the row.
  2. Clear the fixed height. height: auto on .pick lets stretch change Two's cross size.
  3. Fill the line. align-self: stretch grows Two until it meets the top and bottom of the 120px row.
  4. The group rule stays. align-items: flex-start still applies to One and Three. Only Two opted out.

Edge Cases & Pitfalls

If the item does not move, one of these is usually why.

item

It belongs on the item

A rule on the container is align-items. align-self on the container does not move its children.

auto

auto copies the group

The default looks unchanged because it uses align-items. Set a different keyword when that one item should leave the group.

height

stretch loses to a fixed cross size

A height on a row item, or a width on a column item, blocks stretch. Leave that size as auto.

margin

A cross-axis margin: auto wins

On a row item, margin-top: auto or margin-bottom: auto absorbs the spare space and align-self is ignored.

axis

A column flex flips the axis

With flex-direction: column, align-self is horizontal. center then centers that one item left to right.

Browser Support

align-self is a browser layout property for flex items, grid items, and, in new browsers, absolutely positioned boxes. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Flex since 2015

align-self

Flex: Chrome 29+, Firefox 28+, Safari 9+, Edge 12+. Grid: Chrome 57+, Firefox 52+, Safari 10.1+, Edge 16+. Internet Explorer 11 is flex-only.

96% Flex and grid support
Google Chrome 29+ flex · 57+ grid
Full support
Mozilla Firefox 28+ flex · 52+ grid
Full support
Apple Safari 9+ flex · 10.1+ grid
Full support
Microsoft Edge 12+ flex · 16+ grid
Full support
Opera 12.1+ flex · grid in Chromium 57+
Full support
Samsung Internet 4+ flex · 6.2+ grid
Full support
Internet Explorer 11 · Old flex only
Partial
align-self Widely supported

Bottom line: Safe for flex and grid in current browsers. Absolutely positioned boxes need Chrome 122, Firefox 134, or Safari 26. anchor-center needs Chrome 125, Safari 26, or Firefox 147. Internet Explorer's grid uses -ms-grid-row-align, not this property.

Key Takeaways

  • Role: override align-items for one flex item or one grid item.
  • Where: on the item. The container keeps align-items for everyone else.
  • Default: auto, which copies align-items. It is not inherited.
  • Stretch: only when the item's cross size is auto. A fixed height blocks it.

One line: align-self is the exception for a single item. The container still aligns the rest.

Frequently Asked Questions

It overrides align-items for one flex item or one grid item. The other items keep the container's alignment.
The initial value is auto. auto uses the parent's align-items value. It is not the same as normal, and the property is not inherited.
align-items sets the cross-axis alignment for every item in the container. align-self replaces that value for a single item.
Yes. On a grid item it aligns that item inside its grid area on the block axis. The container does not need flex-wrap.
auto copies align-items. If the container is flex-start and the item is auto, the item stays at the start with its siblings.
Flex support is Chrome 29+, Firefox 28+, Safari 9+, and Edge 12+. Grid support starts at Chrome 57, Firefox 52, and Safari 10.1. Internet Explorer 11 is flex-only. It is a browser layout property, not a Node.js feature.

Next: justify-self

Move one grid item along the inline axis instead of the cross axis.

justify-self tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful