Spot the bug - #55

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

your grid’s running a 3-column dungeon, but .card { grid-column: span 4; } is trying to clip through a wall into a 4th column that doesn’t exist. that forces an implicit column / weird placement/overflow depending on how the browser decides to resolve it.

fix is: don’t span 4 on a 3-col grid. either remove the span entirely (let cards auto-place), or if you want a “full-width” card, target that and do 1 / -1.

.card { grid-column: auto; }

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