title: Div won't keep height attribute or center
body: <p>I'm working on a project right now and can't get my content area to center. I believe this is due to the main #content div not having a height when inspected in my browsers. I assign the height in my CSS in the #content but this div doesn't seem to keep the assigned attributes.</p>
  
  <p>Here is a snippet of HTML that contains the #content div:</p>
  
  <pre><code>&lt;div id="content"&gt;
      &lt;div id="mainbox"&gt;
          &lt;h1&gt;title&lt;/h1&gt;
          &lt;h3&gt;title&lt;/h3&gt;
          &lt;p&gt;text&lt;/p&gt;
          &lt;ul&gt;
              &lt;li&gt;Vivamus vestibulum nulla nec ante.&lt;/li&gt;
              &lt;li&gt;Praesent placerat risus quis eros.&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div id="relatedbox"&gt;
          &lt;h1&gt;Related&lt;/h1&gt;
          &lt;p&gt;text&lt;/p&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Then the condensed CSS code is:</p>
  
  <pre><code>#content {
      height: 500px;
      width: 825px;
      margin-left: auto;
      margin-right: auto;
  }
  #content #relatedbox {
      width: 200px;
      font-size: 10pt;
      background-color: white;
      margin: 1em 0.5em 1em;
      border: 3px solid #00824c;
      float: left;
  }
  </code></pre>
  
  <p>I've tried quite a few things including "position: relative" (and absolute), which looked like the solution to many other similar issues. Doesn't fix mine however. The boxes render right but stick to the left hand side of the div.</p>
  
  <p>Thanks in advance for any ideas or help!</p>
  
  <p><strong>EDIT (SOLUTION):</strong> I seem to have found a solution, although I'm not sure it is the best. In my HTML I literally just added the styling to the div itself and it picked it up. I can clear all my CSS code in the #content div but I need to keep the #content id because of some other dependencies. Thanks again for every ones help! The code that fixed it:
  <code>&lt;div id="content" style="height: 500px; width: 850px; position: relative; margin-left: auto; margin-right: auto;"&gt;</code></p>