title: How to vertically align text inside a flexbox?
body: <p>I would like to use flexbox to vertically align some content inside an <code>&lt;li&gt;</code> but not having great success.</p>
  
  <p>I've checked online and many of the tutorials actually use a wrapper div which gets the <code>align-items:center</code> from the flex settings on the parent, but I'm wondering is it possible to cut out this additional element? </p>
  
  <p>I've opted to use flexbox in this instance as the list item height will be a dynamic <code>%</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>* {
    padding: 0;
    margin: 0;
  }
  
  html,
  body {
    height: 100%;
  }
  
  ul {
    height: 100%;
  }
  
  li {
    display: flex;
    justify-content: center;
    align-self: center;
    background: silver;
    width: 100%;
    height: 20%;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;ul&gt;
    &lt;li&gt;This is the text&lt;/li&gt;
  &lt;/ul&gt;</code></pre>
  </div>
  </div>
  </p>