Consider the following example:
div {
border: 1px solid black;
}
.container {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 10px;
}
.container > div {
min-height: 40px;
}
.item3 {
grid-row: span 3;
}
.item4 {
grid-column: span 2;
}
.item5 {
grid-row: span 3;
}
<div class="container">
<div class="item1">1</div>
<div class="item2">2</div>
<div class="item3">3</div>
<div class="item4">4</div>
<div class="item5">5</div>
<div class="item6">6</div>
<div class="item7">7</div>
<div class="item8">8</div>
</div>
Why does the grid-gap on the 5th element work like that? It looks as if the gap is now part of the element. I would expect that the bottom end of the element would be aligned with the bottom end of the 7th element. The 3rd element works as I would expect. Here's the Fiddle.
Edit
If the desired effect is to show the last (implicit) row, the solution is to add grid-auto-rows: 1fr;. See Fiddle.
