title: Vertically center elements in a div
body: <p>I want to keep my <code>div1</code> inner elements centered vertically.</p>
  
  <p>As you can see in my <code>div1</code> <code>display</code>, if I use <code>display: table-cell</code> it aligns elements vertically but the elements go to the top and not centered.</p>
  
  <p>But if I use <code>display: flex</code>, it keep the elements centered but the elements are aligned horizontally.</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>.div1 {
    height: 200px;
    width: 100px;
    background: white;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    display: table-cell;
  }
  
  .span1 {
    text-align: center;
    font-size: 22px;
    color: #111;
    display: table-cell;
    vertical-align: middle;
    word-spacing: 100px;
    font-weight: 600;
    max-height: 120px;
    dispaly: block;
    overflow: hidden;
  }
  
  .underline {
    position: relative;
    height: 20px;
    width: 100%;
    background: black;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="div1"&gt;
    &lt;span class="span1"&gt;God Bless us all.&lt;/span&gt;
    &lt;div class="underline"&gt;&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Jsfiddle: <a href="https://jsfiddle.net/c15dmfws/" rel="nofollow noreferrer">https://jsfiddle.net/c15dmfws/</a></p>