Can someone please explain me why the usage of grid-gap in the wrapper overflows the items? The manual just says it ADDS space between the items, not extending them in any way or something.
CODEPEN: Source
body {
margin: 0
}
.wrapper {
display: grid;
grid-template-columns: 50% 50%;
grid-gap: 10px;
border: 1px solid black;
padding: 10px;
margin: 0 auto;
max-width: 800px;
}
.header {
grid-column: 1/3;
background: red
}
.footer {
grid-column: 1/3;
background: green
}
.item {
padding: 10px
}
.content {
height: 180px
}
.image {
background: yellow
}
.desc {
background: blue
}
@media screen and (min-width:768px) {
.content {
grid-column: 1/3
}
}
<div class="wrapper">
<div class="item header">Header</div>
<div class="item content image">Image</div>
<div class="item content desc">Description</div>
<div class="item content image">Image</div>
<div class="item content desc">Description</div>
<div class="item footer">Footer</div>
</div>
grid-row-gapinstead; but I'd imagine the cause for the behavior is that the grid is still trying to keep the items a certain size (50%), not really sure though