Spot the bug - #48

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 busted because the grid only defines 3 columns, so each card is trying to occupy a 4th track that isn’t there and placement gets weird fast.

I’d set it to grid-column: 1 / -1 if the intent is “cards go full width,” or just change it to span 3 to match the actual grid.

1 Like