Spot the bug - #42

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.

1 Like

grid-column: span 4 is what’s busted — you’ve defined a 3‑column grid, then told every .card to span 4 columns, so the browser starts inventing implicit grid tracks / placements to satisfy it.

Fix depends on intent: if cards are meant to be full-width, make it explicit with .card { grid-column: 1 / -1; }. If they’re meant to flow in the 3-column layout, drop the grid-column rule (or set it to span 1) and let auto-placement do its thing.

1 Like