title: Why doesn't the height of a container element increase if it contains floated elements?
body: <p>I would like to ask how height and float work. I have an outer div and an inner div that has content in it. Its height may vary depending on the content of the inner div but it seems that my inner div will overflow its outside div. What would be the proper way to do it?</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-html lang-html prettyprint-override"><code> &lt;html&gt;
      &lt;body&gt;
          &lt;div style="margin:0 auto;width: 960px; min-height: 100px; background-color:orange"&gt;
           &lt;div style="width:500px; height:200px; background-color:black; float:right"&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>