title: A flexbox grid with three (3) rows and four (4) columns
body: <p>I have a div and I have 12 items aligned at center using flex.</p>
  
  <p>But I just want to have 4 items in row, so I want 3 rows of 4 columns.</p>
  
  <p>This is ok to do with flex? And do you know how to do? </p>
  
  <p>I'm trying to do that like this: <a href="https://jsfiddle.net/18mzsqcx/1/" rel="noreferrer">https://jsfiddle.net/18mzsqcx/1/</a>, but it's not working.</p>
  
  <p>Or it's better to just create a div for example <code>.col4</code> with width equal to 25% and some margins and put this class <code>.col4</code> in each item?</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>*,
  *:after,
  *:before {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
  }
  
  .container {
    float: left;
    width: 100%;
    background-color: red;
  }
  
  .content {
    width: 94%;
    margin: 0px auto;
    background-color: yellow;
    padding: 30px;
  }
  
  .categories {
    display: flex;
    justify-content: space-between;
    background-color: blue;
  }
  
  .categories_item a {
    color: green;
  }
  
  .categories_item {
    flex-grow: 1;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
    &lt;div class="div content"&gt;
  
  
      &lt;div class="categories"&gt;
        &lt;div class="categories_item"&gt;
          &lt;a href="" class=""&gt;
            &lt;span&gt;Item&lt;/span&gt;
          &lt;/a&gt;
        &lt;/div&gt;
  
        &lt;div class="categories_item"&gt;
          &lt;a href="" class=""&gt;
            &lt;span&gt;Item&lt;/span&gt;
          &lt;/a&gt;
        &lt;/div&gt;
  
        &lt;div class="categories_item"&gt;
          &lt;a href="" class=""&gt;
            &lt;span&gt;Item&lt;/span&gt;
          &lt;/a&gt;
        &lt;/div&gt;
  
        &lt;div class="categories_item"&gt;
          &lt;a href="" class=""&gt;
            &lt;span&gt;Item&lt;/span&gt;
          &lt;/a&gt;
        &lt;/div&gt;
  
        &lt;div class="categories_item"&gt;
          &lt;a href="" class=""&gt;
            &lt;span&gt;Item&lt;/span&gt;
          &lt;/a&gt;
        &lt;/div&gt;
  
        &lt;div class="categories_item"&gt;
          &lt;a href="" class=""&gt;
            &lt;span&gt;Item&lt;/span&gt;
          &lt;/a&gt;
        &lt;/div&gt;
  
        &lt;div class="categories_item"&gt;
          &lt;a href="" class=""&gt;
            &lt;span&gt;Item&lt;/span&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="categories_item"&gt;
          &lt;a href="" class=""&gt;
            &lt;span&gt;Item&lt;/span&gt;
          &lt;/a&gt;
        &lt;/div&gt;
  
        &lt;div class="categories_item"&gt;
          &lt;a href="" class=""&gt;
            &lt;span&gt;Item&lt;/span&gt;
          &lt;/a&gt;
        &lt;/div&gt;
  
        &lt;div class="categories_item"&gt;
          &lt;a href="" class=""&gt;
            &lt;span&gt;Item&lt;/span&gt;
          &lt;/a&gt;
        &lt;/div&gt;
  
        &lt;div class="categories_item"&gt;
          &lt;a href="" class=""&gt;
            &lt;span&gt;Item&lt;/span&gt;
          &lt;/a&gt;
        &lt;/div&gt;
  
        &lt;div class="categories_item"&gt;
          &lt;a href="" class=""&gt;
            &lt;span&gt;Item&lt;/span&gt;
          &lt;/a&gt;
        &lt;/div&gt;
  
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>