title: centering an image inside an anchor
body: <p>I am trying to horizontally center an image that is contained within an anchor tag. I have tried setting it as a block and setting margins to auto with no luck. I have tried wrapping it in a div tag and doing the same, still, no luck. Even tried centering the img within the div within the div. I looked at other posts, and nothing seems to help. The image is still aligned to the left no matter what I do.</p>
  <p>###HTML</p>
  <pre><code>&lt;div id=&quot;slideWrapper&quot;&gt;
      &lt;h1 id=&quot;slideHeading&quot;&gt;This is a Header&lt;/h1&gt; 
      &lt;hr/&gt;       
      &lt;div class=&quot;centerMe&quot;&gt;
          &lt;a href=&quot;javascript:slidelink()&quot; class=&quot;slideA&quot;&gt;
              &lt;img src=&quot;./images/Slides/cheeseBoards.jpg&quot; name=&quot;slide&quot; id=&quot;slideImg&quot;/&gt;
          &lt;/a&gt;
      &lt;/div&gt;
      &lt;hr/&gt;
      &lt;div class=&quot;centerMe&quot;&gt;
          &lt;a href=&quot;javascript:slidelink()&quot;class=&quot;slideA&quot; id=&quot;slideText&quot;&gt;Check out our services and other great stuff.&lt;/a&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>###CSS</p>
  <pre><code>.centerMe {
      margin-left: auto;
      margin-right: auto;
      border: 1px solid green;
      text-align: center;
  }
  #slideWrapper {
      border: 1px solid blue; 
  }
  #slideImg {
      display: block;
      height:500px;
      width:900px;
      border:1px solid red;
      margin-left: auto;
      margin-right: auto;
  }
  </code></pre>
  <p>I put borders around everything so that I could see where things were getting placed. It seems like the image isn't being contained within the div for some reason. This seems like it should be so simple. Any help would be greatly appreciated. Thanks.</p>