title: Centering Images With CSS (Without Display: Block)
body: <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>img.imgdemo {
    background: white;
    width: 65%;
    margin: auto;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;a class=imagelink href=periodictable.htm&gt;
    &lt;img class=imgdemo src=ptabledemo.png&gt;
  &lt;/a&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I'm trying to center an image that also acts as a link, but when it has a style of display: block, it acts as a block element, making everything in it's width a link as well. Is there any way to fix this?</p>