title: Expand container div with content width
body: <p>I have the following structure in my application:</p>
  
  <pre><code>&lt;div id="container"&gt;
    &lt;div id="child_container"&gt;
      &lt;div class="child"&gt;&lt;/div&gt;
      &lt;div class="child"&gt;&lt;/div&gt;
      ...
      &lt;div class="child"&gt;&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Each child div has a known fixed width, but the application allows more of them to be inserted in the child_container div.</p>
  
  <p>What I'm trying to do is to have the container div expand horizontally when needed, given the total width of the child container.</p>
  
  <p>This is what happens currently:</p>
  
  <pre><code>+------ container -------+
  +--- child_container ----+
  | child1 child2 child3   |
  | child4                 |
  +------------------------+
  </code></pre>
  
  <p>If I set the child_container div width to a fixed value, I can get it to expand horizontally past the container div, which works despite being a bit ugly:</p>
  
  <pre><code>+------ container -------+
  +------ child_container -+----+
  | child1 child2 child3 child4 |
  +------------------------+----+
  </code></pre>
  
  <p>However, that requires recalculating it whenever a new child is added.</p>
  
  <p>Is there a way to do this without using fixed widths for child container, in a way such that the end result is</p>
  
  <pre><code>+--------- container ---------+
  +------ child_container ------+
  | child1 child2 child3 child4 |
  +-----------------------------+
  </code></pre>
  
  <p>Thanks.</p>