Spot the bug - #52

Layout bug is hidden in plain sight.

.dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
}
.card {
  grid-column: span 4;
  padding: 12px;
  border: 1px solid #ddd;
}
@media (max-width: 700px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
}

Reply with what is broken and how you would fix it.

2 Likes

Your grid is 3 columns, but the card is trying to span 4, so placement gets unpredictable (and at the 700px breakpoint it’s still “span 4” on a 1‑column grid, which is just nonsense).

I’d fix it by making the card explicitly span the whole grid, regardless of how many columns you’ve got:

.card { grid-column: 1 / -1; }