title: How to vertically align all text in CSS?
body: <p>The issue seems to be that certain letters like <code>g</code>, <code>y</code>, <code>q</code>, etc. that have a tail that slopes downwards, do not allow for vertical centering. Here's an image to showcase the problem <a href="https://i.stack.imgur.com/Pcnl8.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Pcnl8.png" alt="a"></a>.</p>
  
  <p>The characters in the green box are basically perfect, as they have no downward tail. Those in the red box demonstrate the problem.</p>
  
  <p>I would like for all characters to be perfectly vertically centered. In the image, characters with a downward tail are not vertically centered. Is this possible to rectify?</p>
  
  <p><a href="https://jsfiddle.net/urs2j3d5/" rel="noreferrer">Here is the fiddle that demonstrates the problem in full</a>.</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>.avatar {
      border-radius: 50%;
      display: inline-block;
      text-align: center;
      width: 125px;
      height: 125px;
      font-size: 60px;
      background-color: rgb(81, 75, 93);
      font-family: "Segoe UI";
      margin-bottom: 10px;
  }
  
  .character {
      position: relative;
      top: 50%;
      transform: translateY(-50%);
      line-height: 100%;
      color: #fff;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="avatar"&gt;
    &lt;div class="character"&gt;W&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="avatar"&gt;
    &lt;div class="character"&gt;y&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>