The align-items property is a sub-property of the Flexible Box Layout module.

It defines the default behaviour for how flex items are laid out along the cross axis on the current line. You can think of it as the justify-content version for the cross-axis (perpendicular to the main-axis).

The align-items property accepts 5 different values:

  • flex-start: cross-start margin edge of the items is placed on the cross-start line
  • flex-end: cross-end margin edge of the items is placed on the cross-end line
  • center: items are centered in the cross-axis
  • baseline: items are aligned such as their baselines align
  • stretch (default): stretch to fill the container (still respect min-width/max-width)

The following figure helps understand how flex items are layed out depending on the align-items value.



align-items: flex-start | flex-end | center | baseline | stretch

.flex-container {
  align-items: flex-start;


The following demo shows how flex items are layed out depending on the align-items value:

  • The red list is set to flex-start
  • The yellow list is set to flex-end
  • The blue list is set to center
  • The green list is set to baseline
  • The pink list is set to stretch
Check out this Pen!

Related Properties

Other Resources

Browser Support

  • (modern) means the recent syntax from the specification (e.g. display: flex;)
  • (hybrid) means an odd unofficial syntax from 2011 (e.g. display: flexbox;)
  • (old) means the old syntax from 2009 (e.g. display: box;)
Chrome Safari Firefox Opera IE Android iOS
21+ (modern)
20- (old)
3.1+ (old) 2-21 (old)
22+ (new)
12.1+ (modern) 10+ (hybrid) 2.1+ (old) 3.2+ (old)

Blackberry browser 10+ supports the new syntax.

For more informations about how to mix syntaxes in order to get the best browser support, please refer to this article (CSS-Tricks) or this article (DevOpera).


  1. User Avatar
    Leevi Graham

    There is an edge case bug with Firefox and align-items: baseline.

  2. User Avatar
    Permalink to comment#

    Thank you very much
    This training was very useful for me.

  3. User Avatar
    Permalink to comment#

    Question for you, on the codepen demo ‘baseline’ case, let’s say I wanted that 3rd green box to align to the “5” instead of the 4. How would I do that?

  4. User Avatar
    John Munson
    Permalink to comment#

    It looks like flex-end is now just end

    • User Avatar
      Leevi Graham
      Permalink to comment#

      I’m pretty sure that change is made in the CSS Box Alignment Module Level 3 Working draft and isn’t a candidate recommendation yet.

Leave a Comment

Posting Code!

You may write comments in Markdown. This makes code easy to post, as you can write inline code like `<div>this</div>` or multiline blocks of code in triple backtick fences (```) with double new lines before and after.

Code of Conduct

Absolutely anyone is welcome to submit a comment here. But not all comments will be posted. Think of it like writing a letter to the editor. All submitted comments will be read, but not all published. Published comments will be on-topic, helpful, and further the discussion or debate.

Want to tell us something privately?

Feel free to use our contact form. That's a great place to let us know about typos or anything off-topic.