liveBook · Manning

Align-self

As explained in Web Design Playground

A CSS flexbox property that overrides the default cross-axis alignment of an individual flex item.

Sometimes one flex item wants to do its own thing. Use align-self to override the cross-axis alignment that align-items gives to every item in a flex container. section 12.6

Think of the two properties as a friendly team:

  • Use align-items when all items should share one cross-axis alignment. section 12.6
  • Use align-self when one item needs a different cross-axis position. section 12.6
  • Set align-self: auto to return that item to the container’s current align-items setting. section 12.6

One item moves to the other side

If a container uses align-items: flex-start, its items begin at the cross-axis start. Give the last item align-self: flex-end, and that one item goes to the cross-axis end instead. section 12.6

item {
    align-self: stretch|flex-start|flex-end|center|baseline;
}

The available alignment values match the cross-axis alignment choices used for flex items. section 12.6

Quick takeaway: align-items sets the group rule; align-self gives one item permission to break it. section 12.18

How Web Design Playground covers it

How deep it goes
Explains the override behavior, matching alignment values, auto reset, and a flex-start/flex-end example without deeper layout mechanics.
Examples
Uses a container aligned flex-start with its last item overridden to flex-end.
What it assumes
Builds on align-items and the flex container’s cross axis, referring back to their earlier explanation.
What you can do after
Operate/configure it to give one flex item a different cross-axis alignment from its siblings.
How it connects
Connects align-self to align-items, flex containers, the cross axis, and flex-direction.

Also explained in

Compare how 3 books explain align-self →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Design Playground. The section links point to the parts of the book it draws on.