title: How to style flex parent to wrap all children
body: <p>I am working on a grid layout using css flex styling and want a total css solution, if possible, I have the means to fix it with javascript.</p>
  
  <p>When a row exceeds the viewport width, it displays the scrollbar,
  but when you scroll, the styling of the row element remains the size of the viewport, 
  it does not seem to "wrap" all of its children.</p>
  
  <p>see : <a href="http://jsfiddle.net/mahks/hserczk5/" rel="nofollow noreferrer">fiddle</a></p>
  
  <p>Try scrolling, you will see the yellow row (.sk_row) class does not appear around all its children. </p>
  
  <p>A solution would be fine, but I would like to know why the parent does not visually contain all children. I think I may be missing some key concept about flexboxes...</p>
  
  <p>Duplicate of fiddle code...</p>
  
  <pre><code>&lt;body&gt;
  &lt;div id='pg_wrap'&gt;
      &lt;div id='frm0'&gt;
          &lt;div class='sk_scrl'&gt;
                  &lt;div class='sk_row'&gt;
                      &lt;div class='itm_val'&gt;row 1&lt;/div&gt;
                      &lt;div class='itm_val'&gt;1&lt;/div&gt;
                      &lt;div class='itm_val'&gt;2&lt;/div&gt;
                      &lt;div class='itm_val'&gt;3&lt;/div&gt;
                      &lt;div class='itm_val'&gt;4&lt;/div&gt;
                      &lt;div class='itm_val'&gt;5&lt;/div&gt;
                      &lt;div class='itm_val'&gt;6&lt;/div&gt;
                      &lt;div class='itm_val'&gt;7&lt;/div&gt;
                      &lt;div class='itm_val'&gt;8&lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class='sk_row'&gt;
                      &lt;div class='itm_val'&gt;row 2&lt;/div&gt;
                      &lt;div class='itm_val'&gt;1&lt;/div&gt;
                      &lt;div class='itm_val'&gt;2&lt;/div&gt;
                      &lt;div class='itm_val'&gt;3&lt;/div&gt;
                      &lt;div class='itm_val'&gt;4&lt;/div&gt;
                      &lt;div class='itm_val'&gt;5&lt;/div&gt;
                      &lt;div class='itm_val'&gt;6&lt;/div&gt;
                      &lt;div class='itm_val'&gt;7&lt;/div&gt;
                      &lt;div class='itm_val'&gt;8&lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;    
  </code></pre>
  
  <p></p>
  
  <pre><code>#frm0{      width:420px;height:200px}
  .sk_scrl{   overflow:auto;display:flex;flex-flow:column;align-content:stretch}
  .sk_row{
      display:flex;
      justify-content:flex-start;
      align-items:center;
      background:#ff0;border:2px #f00 solid;
      height:50px}
  .itm_val{   
      display:flex;
      border:1px #000 solid;background:#666;
      flex:0 0 100px;    height:30px; margin:0 5px;
      align-items:center;justify-content:center}
  </code></pre>
  
  <p><strong>Note :</strong> this is not the same as <a href="https://stackoverflow.com/questions/16213492">question</a>
  That op wants to change child behaviour, I want the parent to change.</p>