title: How to float elements inside a container
body: <p>I am trying to put the <code>#container</code> in the center of the screen and make the 'charts' <code>float:left</code> inside the <code>#container</code>.</p>
  
  <p>But with the code I have below, the 'charts' locate under the <code>#container</code>. Can anyone tell me how can I change the code? And tell me why the code make the 'charts' outside the <code>#container</code>.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#container {
    margin: auto;
    width: 10%;
    border: 3px solid #73AD21;
    padding: 10px;
  }
  #id1,
  #id2,
  #id3,
  #id4 {
    float: left;
    font-size: 30px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="container"&gt;
    &lt;div id="id1"&gt;
      &lt;p&gt;chart1&lt;/p&gt;
    &lt;/div&gt;
    &lt;div id="id2"&gt;
      &lt;p&gt;chart2&lt;/p&gt;
    &lt;/div&gt;
    &lt;div id="id3"&gt;
      &lt;p&gt;chart3&lt;/p&gt;
    &lt;/div&gt;
    &lt;div id="id4"&gt;
      &lt;p&gt;chart4&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>