It works just as if you were using box-sizing: border-box and the add-on, as you can see in this demo. The height is set to 100vh, and you can see that if you delete or add a grid-gap , there is no scroll bar, you just need to remove the field from the body.
body { margin: 0; } .grid { display: grid; height: 100vh; grid-gap: 20px; background: #FF7D7D; grid-template-columns: 1fr 2fr; } .grid > div { background: black; color: white; } div.a, div.d { color: black; background: white; }
<div class="grid"> <div class="a">A</div> <div class="b">B</div> <div class="c">C</div> <div class="d">D</div> </div>
source share