Justify-content and align-items

There's a property you'll learn about later in this chapter called justify-content, which controls alignment along the main axis; the align-items property controls alignment along the cross axis. Here's an important concept. The main axis and cross axis can be toggled based on the flex-direction being set to either a column or row. So the main axis is always the horizontal axis by default, unless you use flex-direction: column and the vertical axis becomes the main axis!

If this is your first taste of flexbox your probably saying, "Hey, slow down!" Not to worry, this is just an introduction to the terminology and a few of the properties and concepts; don't expect to have all this sink in right away. We'll refer ...

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.