Interactive online courses HTML Academy
2026-03-09 14:09 Diff

Remember the justify-content property, which controls the distribution of flex items along the main axis?

There is a very similar property align-content, which controls the alignment of rows of flex items along the cross axis. These properties have practically identical values:

  • flex-start,

  • flex-end,

  • center,

  • space-between,

  • space-around,

  • and stretch, which is also a value of align-content, but which is absent from justify-content and is the default value.

The align-content property overrides any other assigned value of align-items, which controls the alignment of the flex items along the cross axis. This happens when there is only one row of flex items and when there are several such rows.

Previously the specification prescribed a different behavior:

  • if there is only one row of flex items, then align-items takes precedence;
  • if there are several rows, then align-content takes precedence.

For a fairly long time this was the chosen behavior in all browsers. But in early 2019, the behavior was updated in all modern browsers according to the specification.

You may encounter the old behavior in this assignment if you are completing this chapter in an old browser version.