title: Centering an image vertically within a div
body: <p>I have a series <code>&lt;a&gt;</code> tags which represent links on my website. Some of the links have text, and some have an image. Unfortunately, I cannot get the image links vertically centered with the <code>&lt;a&gt;</code>.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.button {
    background-color: #339a8c;
    border-radius: 8px;
    color: #fff;
    font-weight: 400;
    margin: 0 5px;
    padding: 8px;
    text-decoration: none;
  }
  
  .buttonImage {
    background-color: #339a8c;
    border-radius: 8px;
    padding: 8px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="nav"&gt;
    &lt;a class="button" href="/misc/why"&gt;Home&lt;/a&gt;
    &lt;a class="button" href="/about"&gt;About&lt;/a&gt;
    &lt;a class="button" href="/projects"&gt;Projects&lt;/a&gt;
    &lt;a class="buttonImage" href="/cubesolver"&gt;&lt;img height="18px" src="img/cubesolver.png" /&gt;&lt;/a&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>