title: How to create a row of elements of equal width inside an inline container? Possibly using flexbox
body: <p>I'm trying to create a row of elements with the following features:</p>
  
  <ol>
  <li>Are inside an inline-block container (which needs to have content next to it)</li>
  <li>Are all the same width</li>
  <li>Are auto-sized to be wide enough to contain the widest element without it overflowing</li>
  <li>Are auto-sized to be narrow enough to <em>just</em> contain the widest element without it overflowing</li>
  </ol>
  
  <p>My current efforts are using flexbox and haven't been able to fulfil all of these conditions. My latest attempt (tested in Chrome so far) is below but condition 3 is not met.</p>
  
  <p>Is there something I'm missing? Or is there an alternative approach that might work?</p>
  
  <p><a href="http://jsbin.com/riwadume/1/edit?html,output" rel="nofollow noreferrer">live example</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-css lang-css prettyprint-override"><code>div {
    display: inline-block;
  }
  
  ul {
    display: flex;
    margin: 0;
    padding: 0;
    list-style-type: none;
  }
  
  li {
    flex: 1;
  }
  
  a {
    display: block;
    padding: 1em;
    border: solid black 1px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;
    &lt;ul&gt;
      &lt;li&gt;
        &lt;A href="/"&gt;foo&lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;A href="/"&gt;barrrrrrrrr&lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;A href="/"&gt;foooooooooooo&lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;A href="/"&gt;foo&lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;A href="/"&gt;hello&amp;nbsp;world&lt;/a&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>(I'm not using browser compatibility vendor-prefixed versions for this test, so you might have to select a browser with good flexbox support).</p>