Loading Depth Study
Preparing your workspace
Flexbox is a CSS layout system designed for arranging items along one main axis.
Flexbox makes many common layouts easier to build. A flex container is created using display: flex. The flex-direction property controls whether items are arranged in a row or column. justify-content controls alignment along the main axis, while align-items controls alignment along the cross axis. gap creates consistent spacing between items. Flex items can also grow or shrink when space changes. Flexbox is particularly useful for navigation bars, button groups, cards in a row, centered content, and many component-level layouts.
A course card footer can use Flexbox to place the lesson count on the left and a Start button on the right.
.card-footer {
display: flex;
justify-content: space-between;
align-items: center;
gap: 16px;
}The two pieces of content are placed on opposite sides of the footer and vertically aligned.