title: Need to center image in web page via CSS
body: <p>I'd like to center an image in a page both vertically and horizontally even when the browser is resized.</p>
  
  <p>Currently, I use this CSS:</p>
  
  <pre><code>.centeredImage {
    position: fixed;
    top: 50%;
    left: 50%;
    margin-top: -50px;
    margin-left: -150px;
  }
  </code></pre>
  
  <p>And this HTML:</p>
  
  <pre><code>&lt;img class="centeredImage" src="images/logo.png"&gt;
  </code></pre>
  
  <p>It centers in FF but not IE (image center is placed at upper left corner).  Any ideas?</p>
  
  <p>-Robot</p>