title: Why does my div not center properly?
body: <p>I'm using $.blockUI with jQuery to show a modal dialogue. The HTML looks like:</p>
  
  <pre><code>&lt;div id="progressDialogue" class="mp_modalpopup"&gt;
      &lt;div class="mp_container"&gt;
          &lt;div class="mp_header"&gt;
              &lt;span id="pd_header_text" class="mp_msg"&gt;Please wait..&lt;/span&gt;
          &lt;/div&gt;
          &lt;div class="mp_body"&gt;
              &lt;img src="ajax-loader.gif" style="text-align:center" alt="loading" /&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The CSS looks like:</p>
  
  <pre><code>.mp_modalpopup
  {
      font-family: arial,helvetica,clean,sans-serif;
      font-size: small;
      padding: 2px 3px;
      bottom: 50%;
      right: 50%;
      position: absolute;
      width: 400px;
      z-index:999;    
  }
  
  .mp_container
  {
      width: 400px;
      border: solid 1px #808080;
      border-width: 1px 1px;
      left: 50%;
      position: relative;
      top: 50%;
  }
  
  /* removed mp_header, mp_body, mp_msg CSS for brevity */
  </code></pre>
  
  <p>This will happily render smack bang in the center of the page on top of other HTML.</p>
  
  <p>However if I set <code>display:none</code> in the <code>.mp_modalpopup</code> CSS class and then use $.blockUI to make it visible, in IE 8 the dialogue centers itself vertically but aligns left with half of the dialogue off the page and in Google Chrome and Firefox the dialogue is not visible at all (but blockUI is working because the page greys out).</p>
  
  <p>This is the blockUI javascript:</p>
  
  <pre><code>$.blockUI.defaults.css = {};
  
  $.blockUI({ 
      message: $('#progressDialogue'), 
      overlayCSS: { backgroundColor: '#000', opacity: 0.1 },
      css: {backgroundColor: '#00f', color: '#100'} 
  });
  </code></pre>
  
  <p>Why is this happening?</p>