title: Clear: both overrides margin: 0 auto?
body: <p>I'm having a positioning problem I need to deal with. In the container div I have two divs, which both should be horizontally centered under each other. However, I'm having problems with the positioning of the second div.</p>
  
  <p>If I add clear:both div 2 gets on a new line, which is desired. However, if using clear:both margin: 0 auto; doesn't work. What could I use instead to make the div centered?</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;div class="row-fluid"&gt;
      &lt;div class="span6 offset3 text-center header"&gt;
          &lt;h1&gt;Title...&lt;/h1&gt;
          &lt;p&gt;Text...&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class="span3 offset4"&gt;
          &lt;form&gt;
            ...
          &lt;/form&gt;                 
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>CSS:</strong></p>
  
  <pre><code>.register .span3 {
      width: 270px;
      clear: both;
      margin: 0 auto;
  }
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>- Without clear:both
   ____________________________________
  |                                    |
  |              ______       ______   |
  |             |      |     |      |  |
  |             | div 1|     | div 2|  |
  |             |______|     |______|  |
  |                                    |
  |                                    |
  |                                    |
  |                                    |
  |                                    |
  |                                    |
  
  
  - WITH clear:both
   ____________________________________
  |                                    |
  |              ______                |
  |             |      |               |
  |             | div 1|               |
  |             |______|               |
  |  ______                            |
  | |      |                           |
  | | div 2|                           |
  | |______|                           |
  |                                    |
  |                                    |
  
  - Desired output
   ____________________________________
  |                                    |
  |              ______                |
  |             |      |               |
  |             | div 1|               |
  |             |______|               |
  |              ______                |
  |             |      |               |
  |             | div 2|               |
  |             |______|               |
  |                                    |
  |                                    |
  </code></pre>