Use `justify-content` on a flex container to position its children along the axis Flexbox is using. It distributes leftover space inside that container. Put the declaration on the parent, not on the item you want to move. section 6.4 section 6.9
Choose a value to match the layout you want:
- `center` centers a profile card when its parent, `body`, has `display: flex`. Pair it with `align-items: center` to center the card vertically too. section 6.4
- `space-around` spreads profile statistics across a row, leaving equal space between groups and half as much at each edge. section 6.7.2
- `space-between` places credit-card details at opposite edges, with space between them. `flex-end` keeps text at the end of a security-code band. section 9.2.2 section 9.2.3
Center two actions without crowding them
Set `.actions { display: flex; gap: 16px; justify-content: center; }`. `justify-content` centers the link and button as a group; `gap` preserves space between them. The same pairing works for profile statistics, where a `12px` gap supplies minimum separation while `space-around` distributes the remaining room. section 6.8 section 6.7.2
Watch the widths of your items. With `space-around`, evenly distributed free space does not guarantee that the middle item sits at the container’s exact center: a wider group on one side can shift it. section 6.7.2
Listing 6.5 Centering the card
body {
...
display: flex;
justify-content: center; #1
align-items: center; #2
}
The body rule shows `display: flex` on the parent, then `justify-content: center` and `align-items: center` positioning its card. section 6.4



