title: Centering a div which has an image overlayed on top
body: <p>I have a container div with an image overlayed on top of it.</p>
  
  <p>I want to center this container div within a basic popin.  I am sure it has something to do with the overlay approach I am using within the CSS, but I cannot figure it out.  How can I center the container dev within the popin?</p>
  
  <p>EDIT:  There are several of these blocks placed in-line.</p>
  
  <p>CSS and HTML are as follows:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.containerdiv { float: left; position: relative; } 
  .cornerimage { position: absolute; top: 0; left: 0; }
  
  .popin{
    background:#fff;
    padding:15px;
    box-shadow: 0 0 20px #999;
    border-radius:2px;
  }
  
  #underlay1 {
    width: 320px;
    height: 320px;
    position: relative;
  }
  
  #underlay2 {
    width: 320px;
    height: 320px;
    position: relative;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="row"&gt;
    &lt;div class="col-md-4 col-sm-6 popin"&gt;
      &lt;div class="containerdiv"&gt;
        &lt;div id="underlay1"&gt;&lt;/div&gt;
        &lt;img class="cornerimage" border="0" src="http://lorempixel.com/320/320" alt=""&gt;  
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="col-md-4 col-sm-6 popin"&gt;
      &lt;div class="containerdiv"&gt;
        &lt;div id="underlay2"&gt;&lt;/div&gt;
        &lt;img class="cornerimage" border="0" src="http://lorempixel.com/320/320" alt=""&gt;  
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Underlay is receiving an image from an API.  overlayimage.gif is another image being placed on top.</p>