title: How can I make these divs grow to fill the size of their container?
body: <p>I'm trying to write a function that takes a users input to create a grid (16x16, 32x32 etc). The issue I'm having is getting the appended divs to scale properly to the container.</p>
  <p>here is what it looks like:
  <a href="https://i.stack.imgur.com/7xvFp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7xvFp.png" alt="here is what it looks like" /></a></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-js lang-js prettyprint-override"><code>function createGrid(input) {
    const gridContainer = document.querySelector('.gridContainer');
    for (let i = 0; i &lt; input; i++) {
      const row = document.createElement('div');
      row.className = 'row';
      for (let j = 1; j &lt;= input; j++) {
        const pixel = document.createElement('div');
        pixel.className = 'pixel';
        row.appendChild(pixel);
      }
      gridContainer.appendChild(row);
    }
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
    height: 100vh;
  }
  
  .pixel {
    flex: 1;
    min-width: 8px;
    min-height: 8px;
    border: 0.1px solid black;
  }
  
  .gridContainer {
    display: flex;
    flex-direction: row;
    width: 600px;
    height: 600px;
    border: 2px solid red;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    align-items: stretch;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="gridContainer"&gt;
  
  &lt;/div&gt;
  
  &lt;input class="gridSize" type="number"&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>I thought adding flex 1 with a minimum width and height to the divs would do the trick so I must be missing something here. (I'm a noob so I apologize in advance if it's a super easy fix).</p>