title: Html flexbox container does not expand over wrapped children
body: <p>I need to have a layout that looks somewhat similar to the windows metro start screen with tiles. To do so I try use flexbox layout. But have stuck with a problem that parent flex container does not wrap around its children if they are wrapped to the next column.</p>
  
  <p>Here is sample fiddle: <a href="http://jsfiddle.net/ssn4fnd7/4/" rel="nofollow">flex wrapping</a></p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class="top"&gt;
    &lt;span class="middle"&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class="middle"&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
        &lt;span class="bottom"&gt;0&lt;/span&gt;
    &lt;/span&gt;
  &lt;div&gt;
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>.top
  {
      display: -webkit-box;
      display: -moz-box;
      display: -ms-flexbox;
      display: -webkit-flex;
      display: flex;
      -webkit-flex-flow: row wrap;
      flex-flow: row wrap;
      justify-content: space-around;
      align-content: stretch;
      height: 400px;
      width:800px;
      background-color:gray;
  }
  
  .middle
  {
      display: -webkit-box;
      display: -moz-box;
      display: -ms-flexbox;
      display: -webkit-flex;
      display: flex;
      -webkit-flex-flow: column wrap;
      flex-flow: column wrap;
      justify-content: flex-start;
      background-color: blue;
      margin: 5px;
  }
  
  .bottom
  {
      background: tomato;
      margin: 5px;
      width: 50px;
      height: 50px;
      color: white;
      font-weight: bold;
      font-size: 3em;
      text-align: center;
  }
  </code></pre>
  
  <p>As you see I have parent flex container that wraps by rows (.top). Each row is made up of flex containers that wrap its content by column (.middle). The problem is that middle containers (blue ones) do not wrap around their children that are moved to the next column.</p>
  
  <p>I would appreciate any advice. Thanks.</p>