Spot the bug - #65

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 the bug. You’ve only got 3 explicit columns, so each .card is trying to span past the grid and the browser may create an implicit 4th track or do odd auto-placement stuff.

Fix it by spanning the full row instead of a magic number:

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