title: Centering text in CSS grid
body: <p>Could you help me in aligning the number 6 vertically in the div, using only CSS-grid?</p>
  
  <p>I'm learning CSS-grid and my idea is to be able to center and align text horizontally as well as vertically. It often gives me problems. This time I need to do it entirely on CSS-grid. Have you got any ideas?</p>
  
  <p>No absolute or relative positioning... only CSS-grid.</p>
  
  <p>Here the code so you can give it a try:</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>.grid-container {
    display: grid;
    grid-template-columns: auto auto auto auto auto auto auto;
    grid-gap: 10px;
    background-color: #2196F3;
    padding: 10px;
  }
  
  .grid-container &gt; div {
    background-color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 20px 0;
    font-size: 50px;
  }
  
  .item6 {
    grid-area: 1 / 6 / 3 / 8;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="grid-container"&gt;
    &lt;div class="item1"&gt;1&lt;/div&gt;
    &lt;div class="item2"&gt;2&lt;/div&gt;
    &lt;div class="item3"&gt;3&lt;/div&gt;
    &lt;div class="item4"&gt;4&lt;/div&gt;
    &lt;div class="item5"&gt;5&lt;/div&gt;
    &lt;div class="item6"&gt;6&lt;/div&gt;
    &lt;div class="item7"&gt;7&lt;/div&gt;
    &lt;div class="item8"&gt;8&lt;/div&gt;
    &lt;div class="item9"&gt;9&lt;/div&gt;
    &lt;div class="item10"&gt;10&lt;/div&gt;
    &lt;div class="item11"&gt;11&lt;/div&gt;
    &lt;div class="item12"&gt;12&lt;/div&gt;
    &lt;div class="item13"&gt;13&lt;/div&gt;
    &lt;div class="item14"&gt;14&lt;/div&gt;
    &lt;div class="item15"&gt;15&lt;/div&gt;
    &lt;div class="item16"&gt;16&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>