title: How to repeat a CSS grid layout pattern?
body: <p>I'm trying to make a grid layout with repeating 2 vertical, 2 horizontal sections. Then 2 horizontal, 2 verticals, and we repeat again.</p>
  
  <p>Like this: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.container {
    max-width:940px;
    margin: 0 auto;
  }
  
  .grid-container {
    counter-reset: div;
    display:grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 186px;
    grid-gap:20px;
    justify-content:center;
      grid-template-areas: 
      "vert1 vert2 hor1 hor1"
      "vert1 vert2 hor2 hor2"
      "hor3 hor3 vert3 vert4"
      "hor4 hor4 vert3 vert4"
  }
  
  .item-a {
      grid-area: vert1;
  }
  .item-b {
    grid-area: vert2;
  }
  .item-c {
    grid-area: hor1;
  }
  .item-d {
    grid-area: hor2;
  }
  .item-e {
    grid-area: hor3;
  }
  .item-f {
    grid-area: hor4;
  }
  .item-g {
    grid-area: vert3;
  }
  .item-h {
    grid-area: vert4;
  }
  .item-j {
    grid-area: hor2;
  }
  .item-k {
    grid-area: hor2;
  }
  .item-l {
    grid-area: hor2;
  }
  .item-m {
    grid-area: hor2;
  }
  
  
  .grid-container &gt; div {    
  box-shadow: 0 0 11px 0 #b9b9b9;
  }
  
  .grid-container &gt; div:before {
    counter-increment: div;
    content: counter(div);
    margin: auto;
    font-size: 40px;
    display:flex;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
  &lt;div class="grid-container"&gt;
  &lt;div class="item-a"&gt;&lt;/div&gt;
  &lt;div class="item-b"&gt;&lt;/div&gt;
  &lt;div class="item-c"&gt;&lt;/div&gt;
  &lt;div class="item-d"&gt;&lt;/div&gt;
  &lt;div class="item-e"&gt;&lt;/div&gt;
  &lt;div class="item-f"&gt;&lt;/div&gt;
  &lt;div class="item-g"&gt;&lt;/div&gt;
  &lt;div class="item-h"&gt;&lt;/div&gt;
   &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I can't find a way to get it on the auto(infinite) rows, only with grid-template-areas.</p>
  
  <pre><code>grid-template-areas: 
      "vert1 vert2 hor1 hor1"
      "vert1 vert2 hor2 hor2"
      "hor3 hor3 vert3 vert4"
      "hor4 hor4 vert3 vert4"
  </code></pre>
  
  <p>Someone got any ideas?</p>