title: How can I make Flexbox children 100% height of their parent?
body: <p>I'm trying to fill the vertical space of a flex item inside a Flexbox.</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 {
    height: 200px;
    width: 500px;
    display: flex;
    flex-direction: row;
  }
  .flex-1 {
    width: 100px;
    background-color: blue;
  }
  .flex-2 {
    position: relative;
    flex: 1;
    background-color: red;
  }
  .flex-2-child {
    height: 100%;
    width: 100%;
    background-color: green;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
    &lt;div class="flex-1"&gt;&lt;/div&gt;
    &lt;div class="flex-2"&gt;
      &lt;div class="flex-2-child"&gt;&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>And here's the <a href="https://jsfiddle.net/2ZDuE/" rel="noreferrer">JSFiddle</a></p>
  
  <p><code>flex-2-child</code> doesn't fill the required height except in the two cases where:</p>
  
  <ol>
  <li><code>flex-2</code> has a height of 100% (which is weird because a flex item has a 100% by default + it is buggy in Chrome)</li>
  <li><code>flex-2-child</code> has a position absolute which is also inconvenient</li>
  </ol>
  
  <p>This doesn't work in Chrome or Firefox currently.</p>