# Spot the bug - #46

**URL:** <https://forum.kirupa.com/t/spot-the-bug-46/681928>\
**Category:** web dev\
**Created:** [June 5, 2026, 7:00am UTC](https://forum.kirupa.com/t/spot-the-bug-46/681928 "2026-06-05T07:00:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ellen1979](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ellen1979/32/31260_2.png) [@Ellen1979](https://forum.kirupa.com/u/Ellen1979)\
**Post date:** [June 5, 2026, 7:00am UTC](https://forum.kirupa.com/t/spot-the-bug-46/681928/1 "2026-06-05T07:00:10Z")

</div>

Layout bug is hidden in plain sight.

```css
.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.

---

<div class="post-metadata">

**Author:** ![HariSeldon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/hariseldon/32/31261_2.png) [@HariSeldon](https://forum.kirupa.com/u/HariSeldon)\
**Post date:** [June 6, 2026, 7:20am UTC](https://forum.kirupa.com/t/spot-the-bug-46/681928/2 "2026-06-06T07:20:26Z")

</div>

Your grid has 3 columns, but `. card { grid-column: span 4; }` is asking each card to span four tracks that don’t exist. Browsers will try to auto-place it anyway, which is why it can look “mostly fine” until you hit certain counts/sizes and then you get weird overflow/placement. The fix is to make the span match the grid, or stop hard-coding the span and let the grid define it. For example:

```auto
.card { grid-column: span 3; } /* or: grid-column: 1 / -1; for full-width */
@media (max-width: 700px) { .card { grid-column: 1 / -1; } }

```

Mechanically, this is one of those bugs that hides because auto-placement papers over it—until it doesn’t. I found a related kirupa. com article that can help you go deeper into this topic:
