Using align-content

Alright, let's take a look at another property called align-content. Like flex-wrap, align-content is a property that only works on the flex container; however, align-content is dependent on flex-wrap being set to wrap or wrap-reverse, which means align-content is ignored under all other scenarios. Also, align-content is similar to align-items because it controls arrangements or alignments along the cross axis. The only difference is that instead of redistributing each flex item along the cross axis, it redistributes each row along the cross axis.

Let's set a align-content to space-between. We'll also give it a height of 300px and a dark gray border:

.flex-container {  margin-top: 200px;  display: flex; justify-content: ...

Get Mastering CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.