# Last row of my flexbox cards spreads out with space-between

Source: https://coursesweb.net/forum/t/last-row-of-my-flexbox-cards-spreads-out-with-space-between/
Site: CoursesWeb Forum, category CSS Layout: Flexbox and Grid
Published: 2026-12-03. Updated: 2026-12-04. Replies: 1.

## Question by Gaelle R., 2026-12-03

I have a list of team cards. Three per row on desktop. I use flexbox with space-between. When there are 7 cards, the last row has one card on the left. Fine. But with 8 cards, the last row has one card at the far left and one at the far right, with a big hole in the middle.

```css
.team {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.card { width: 32%; margin-bottom: 1rem; }
```

I want the last row to start on the left like the other rows. I tried adding empty divs at the end. It works, but it is ugly and the number changes. Is there a clean CSS way?

## Reply 1 by Mpho N., 2026-12-04

Use justify-content: flex-start and put margin-right on each card. Except the third one, so use :nth-child(3n) { margin-right: 0 }. Done.

---
Cite as: CoursesWeb Forum, "Last row of my flexbox cards spreads out with space-between", https://coursesweb.net/forum/t/last-row-of-my-flexbox-cards-spreads-out-with-space-between/, accessed 2026-12-04.
