title: How to align grid items vertically using display:grid and fill all vertical empty space?
body: <p>I use display:grid not flex to display some divs.</p>
  <p><strong>Here's what my page looks like:</strong></p>
  <p><img src="https://i.stack.imgur.com/cz1lc.jpg" alt="Here's what my page looks like" /></p>
  <p><strong>And here is how I would like it to look:</strong></p>
  <p><img src="https://i.stack.imgur.com/w86IZ.jpg" alt="And here is how I would like it to look" /></p>
  <p>And here's the code:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.container {
    display: grid;
    grid-template-columns: 1.5fr 2fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    grid-auto-columns: 1fr;
    grid-auto-rows: 1fr;
    gap: 40px 40px;
    grid-auto-flow: row dense;
    justify-items: stretch;
    align-items: stretch;
    grid-template-areas: "left1 center-div right1" "left1 center-div right2" "left2 center-div right3";
    width: 100%;
    height: 100%;
  }
  
  .left1 {
    grid-area: left1;
  }
  
  .left2 {
    grid-area: left2;
  }
  
  .center-div {
    grid-area: center-div;
  }
  
  .right1 {
    grid-area: right1;
  }
  
  .right2 {
    grid-area: right2;
  }
  
  .right3 {
    grid-area: right3;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container owl-carousel owl-theme"&gt;
  
    &lt;div class="grid-item left1"&gt;
      left image 1
    &lt;/div&gt;
  
    &lt;div class="grid-item left2"&gt;
      left image 2
    &lt;/div&gt;
  
    &lt;div class="grid-item center-div"&gt;
      center image
    &lt;/div&gt;
  
    &lt;div class="grid-item right1"&gt;
      right image 1
    &lt;/div&gt;
  
    &lt;div class="grid-item right2"&gt;
      right image 2
    &lt;/div&gt;
  
    &lt;div class="grid-item right3"&gt;
      right image 3
    &lt;/div&gt;
  
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>In short, I want to bring the divs closer so that they appear as they are in the second photo</p>