vxh.viet
9/13/2018 - 6:13 AM

Center text in div

How to Center Text in div:

SOURCE, SOURCE, SOURCE

Bootstrap 4:

<div class="row d-flex">
    <span class="mx-auto" id="quantity">Something</span>
</div>

Or pure CSS:

#outer {
  width: 100%;
  height: 100vh;
  display: flex;
}

#inner {
  margin: auto;
}
<div id="outer" class="container">
  <div id="inner">
    <h1>Heading</h1>
    <p>Some content</p>
  </div>
</div>