Starlit Daily

📚 › CSS: style and layout

11. Flexbox: arranging items in a row

Set display: flex on a container and its children line up in a row. justify-content spreads them along the row, and align-items moves them up or down. gap sets the space between items.

Flexbox is the simplest modern tool for menus, toolbars and card rows.

Show example

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

✍️ Your turn

Make .row a flex container with justify-content center and a gap of 10px.

← Back to course