title: How to make single-line text center align while multi-line left align?
body: <p>I am using below css to align text middle and left when multi-line, but how to align text middle and center when one line?</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>.my-text {
      border: 1px solid black;
      width: 400px;
      height: 160px;
      vertical-align: middle;
      display: table-cell;
      overflow: hidden;
      line-height: 20px;
      padding: 20px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="my-text"&gt;
      carpe diem
  &lt;/div&gt;
  &lt;div class="my-text"&gt;
      carpe diem carpe diem carpe diem carpe diem carpe diem carpe diem carpe diem carpe diem carpe diem carpe diem carpe diem carpe diem carpe diem
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>