title: Center text and float div to the right
body: <p>I have a container div which has text within it that I want centered. I want to also insert a div into the container which floats to the right, like this:</p>
  
  <pre><code>&lt;div id="container" style="text-align:center"&gt;
    Text
    &lt;div id="child" style="float:right"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Unfortunately what happens is that the text is no longer centered with respect to the container, but is instead shifted to the left by the width of the child.</p>
  
  <p>Does anyone know how to get the text to center whilst keeping the div contained to the right?</p>