.container {
display:grid;
grid-template-columns: 200px 200px;
grid-template-rows: 100px 100px;
grid-auto-flow: row;
grid-gap: 5px 5px;
height:500px;
width:50%;
border: 1px solid;
}
.grid-box {
background-color: skyblue;
padding: 10px 5px;
}
.four {
grid-column: span 2/3;
grid-row: 2;
}
<div class="container">
<div class="grid-box one">First</div>
<div class="grid-box two">two</div>
<div class="grid-box three">three</div>
<div class="grid-box four">Four</div>
<div class="grid-box five">Five</div>
<div class="grid-box six">Six</div>
</div>
From what I read, span 2/3 should be invalid, and not work, and indeed, it doesn't seem to work properly, as the item does not start from the 2nd column, however, it does end at the 3rd.
However, using span 2/4, produces the following outcome:
.container {
display:grid;
grid-template-columns: 200px 200px;
grid-template-rows: 100px 100px;
grid-auto-flow: row;
grid-gap: 5px 5px;
height:500px;
width:50%;
border: 1px solid;
}
.grid-box {
background-color: skyblue;
padding: 10px 5px;
}
.four {
grid-column: span 2/4;
grid-row: 2;
}
<div class="container">
<div class="grid-box one">First</div>
<div class="grid-box two">two</div>
<div class="grid-box three">three</div>
<div class="grid-box four">Four</div>
<div class="grid-box five">Five</div>
<div class="grid-box six">Six</div>
</div>
Seemingly it works exactly as expected. The item starts from the 2nd column and ends the 4rth.
So, does it actually work? Why does it work now, but it doesn't work if the item ends at the 3rd column?