title: CSS flexbox max column number?
body: <p>I'd like my css flexboxes to have a maximum of 3 columns when the user extends their browser window. With my current code, it flexes correctly inwards, with no minimum number of columns, but when extending outwards it will always automatically extend all the flexboxes out into a single line.
  <a href="http://jsfiddle.net/oq6prk1p/581/" rel="noreferrer">http://jsfiddle.net/oq6prk1p/581/</a></p>
  <p>In this case, I'm trying to only use the css file to achieve this, and am not editing the html file at all. So far this is the closest I've gotten:</p>
  <p>html file:</p>
  <pre><code>&lt;main class=&quot;twit-container&quot;&gt;
  
    &lt;article class=&quot;twit&quot;&gt;
      &lt;div class=&quot;twit-icon&quot;&gt;
        &lt;i class=&quot;fa fa-bullhorn&quot;&gt;&lt;/i&gt;
      &lt;/div&gt;
      &lt;div class=&quot;twit-content&quot;&gt;
        &lt;p class=&quot;twit-text&quot;&gt;
          Sitting in web dev... This class is so awesome!
        &lt;/p&gt;
        &lt;p class=&quot;twit-attribution&quot;&gt;
          &lt;a href=&quot;#&quot;&gt;CSMajor2017&lt;/a&gt;
        &lt;/p&gt;
      &lt;/div&gt;
    &lt;/article&gt;
  
    &lt;article class=&quot;twit&quot;&gt;
      &lt;div class=&quot;twit-icon&quot;&gt;
        &lt;i class=&quot;fa fa-bullhorn&quot;&gt;&lt;/i&gt;
      &lt;/div&gt;
      &lt;div class=&quot;twit-content&quot;&gt;
        &lt;p class=&quot;twit-text&quot;&gt;
          text
        &lt;/p&gt;
        &lt;p class=&quot;twit-attribution&quot;&gt;
          &lt;a href=&quot;#&quot;&gt;BeaverBeliever&lt;/a&gt;
        &lt;/p&gt;
      &lt;/div&gt;
    &lt;/article&gt;
  
    &lt;article class=&quot;twit&quot;&gt;
      &lt;div class=&quot;twit-icon&quot;&gt;
        &lt;i class=&quot;fa fa-bullhorn&quot;&gt;&lt;/i&gt;
      &lt;/div&gt;
      &lt;div class=&quot;twit-content&quot;&gt;
        &lt;p class=&quot;twit-text&quot;&gt;
           text
        &lt;/p&gt;
        &lt;p class=&quot;twit-attribution&quot;&gt;
          &lt;a href=&quot;#&quot;&gt;NewtonRulez&lt;/a&gt;
        &lt;/p&gt;
      &lt;/div&gt;
    &lt;/article&gt;
  
    &lt;article class=&quot;twit&quot;&gt;
      &lt;div class=&quot;twit-icon&quot;&gt;
        &lt;i class=&quot;fa fa-bullhorn&quot;&gt;&lt;/i&gt;
      &lt;/div&gt;
      &lt;div class=&quot;twit-content&quot;&gt;
        &lt;p class=&quot;twit-text&quot;&gt;
          Huh?
        &lt;/p&gt;
        &lt;p class=&quot;twit-attribution&quot;&gt;
          &lt;a href=&quot;#&quot;&gt;ConfusedTweeterer&lt;/a&gt;
        &lt;/p&gt;
      &lt;/div&gt;
    &lt;/article&gt;
  
    &lt;article class=&quot;twit&quot;&gt;
      &lt;div class=&quot;twit-icon&quot;&gt;
        &lt;i class=&quot;fa fa-bullhorn&quot;&gt;&lt;/i&gt;
      &lt;/div&gt;
      &lt;div class=&quot;twit-content&quot;&gt;
        &lt;p class=&quot;twit-text&quot;&gt;
          text
        &lt;/p&gt;
        &lt;p class=&quot;twit-attribution&quot;&gt;
          &lt;a href=&quot;#&quot;&gt;Setup&lt;/a&gt;
        &lt;/p&gt;
      &lt;/div&gt;
    &lt;/article&gt;
  
    &lt;article class=&quot;twit&quot;&gt;
      &lt;div class=&quot;twit-icon&quot;&gt;
        &lt;i class=&quot;fa fa-bullhorn&quot;&gt;&lt;/i&gt;
      &lt;/div&gt;
      &lt;div class=&quot;twit-content&quot;&gt;
        &lt;p class=&quot;twit-text&quot;&gt;
          text
        &lt;/p&gt;
        &lt;p class=&quot;twit-attribution&quot;&gt;
          &lt;a href=&quot;#&quot;&gt;Punchline&lt;/a&gt;
        &lt;/p&gt;
      &lt;/div&gt;
    &lt;/article&gt;
  
    &lt;article class=&quot;twit&quot;&gt;
      &lt;div class=&quot;twit-icon&quot;&gt;
        &lt;i class=&quot;fa fa-bullhorn&quot;&gt;&lt;/i&gt;
      &lt;/div&gt;
      &lt;div class=&quot;twit-content&quot;&gt;
        &lt;p class=&quot;twit-text&quot;&gt;
          text
        &lt;/p&gt;
        &lt;p class=&quot;twit-attribution&quot;&gt;
          &lt;a href=&quot;#&quot;&gt;Hess&lt;/a&gt;
        &lt;/p&gt;
      &lt;/div&gt;
    &lt;/article&gt;
  
    &lt;article class=&quot;twit&quot;&gt;
      &lt;div class=&quot;twit-icon&quot;&gt;
        &lt;i class=&quot;fa fa-bullhorn&quot;&gt;&lt;/i&gt;
      &lt;/div&gt;
      &lt;div class=&quot;twit-content&quot;&gt;
        &lt;p class=&quot;twit-text&quot;&gt;
          text
        &lt;/p&gt;
        &lt;p class=&quot;twit-attribution&quot;&gt;
          &lt;a href=&quot;#&quot;&gt;TheIRS&lt;/a&gt;
        &lt;/p&gt;
      &lt;/div&gt;
    &lt;/article&gt;
  
  &lt;/main&gt;
  
  &lt;button type=&quot;button&quot; id=&quot;create-twit-button&quot;&gt;&lt;i class=&quot;fa fa-bullhorn&quot;&gt;&lt;/i&gt;&lt;/button&gt;
  </code></pre>
  <p>css file:</p>
  <pre class="lang-css prettyprint-override"><code>.twit-container {
    display: flex;
    flex-wrap: wrap;
    padding: 5%;
    margin:-10px 0 0 -10px;
    position: relative;
  }
  
  .twit {
    display: inline-block;
    padding: 20px;
    width: 150px;
    height: 200px;
    margin: 10px 0 0 1%;
    background-color: #fff;
    border: 1px solid #ccc;
    flex-grow: 1;
    outline: 2px solid blue;
  }
  </code></pre>