title: All widths set to width of widest element
body: <p>I've read a lot of tutorials about CSS flex boxes and CSS grids, but frankly I just can't figure out how to do this simple(?) thing.</p>
  
  <p>All I want is for the elements in a container to all be as wide as the widest element.</p>
  
  <p>I don't want them to fill up the whole width of the container, just all grow to the maximum width. Can that be done with CSS?</p>
  
  <p>Consider this HTML:</p>
  
  <pre><code>&lt;div class="container"&gt;
     &lt;button&gt;a normal button&lt;/button&gt;
     &lt;button&gt;tiny&lt;/button&gt;
     &lt;button&gt;a really, really, really wide button&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>That produces something like this:</p>
  
  <p><a href="https://i.stack.imgur.com/47cm9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/47cm9.png" alt="enter image description here"></a></p>
  
  <p>What I want is something like this, where they're all the width of that widest button:</p>
  
  <p><a href="https://i.stack.imgur.com/Dp2XH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Dp2XH.png" alt="enter image description here"></a></p>
  
  <p>I DON'T want them to just stretch out to fill the width of the page:</p>
  
  <p><a href="https://i.stack.imgur.com/QZb4n.png" rel="noreferrer"><img src="https://i.stack.imgur.com/QZb4n.png" alt="enter image description here"></a></p>
  
  <p>Can this be done? If so, what would be the CSS for the above HTML?</p>