.container {
display: flex;
flex-direction: row | column; /* axis */
justify-content: flex-start | center | space-between | space-around;
align-items: stretch | center | flex-start | flex-end;
flex-wrap: nowrap | wrap; /* wrap to next line */
gap: 16px; /* space between items */
}
.item {
flex: 1; /* grow + shrink + basis = equal distribution */
flex-grow: 2; /* take twice as much free space */
align-self: center; /* individual alignment */
order: -1; /* reorder without changing HTML */
}
Flexbox is one-dimensional (row OR column). CSS Grid is two-dimensional (rows AND columns simultaneously). For nav bars and card lists — Flexbox. For complex page layouts — Grid.