title: Bootstrap 4: how to center a card
body: <p>I am building a school website template using Bootstrap 4. </p>
  
  <p>I use a card to make the staff page. But I can't center the card.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;div class="card text-center" style="width: 21.5em;"&gt;
     &lt;img class="card-img-top" src="images/placeholder.jpg" alt="Card image cap"&gt;
     &lt;div class="card-body"&gt;
        &lt;h5 class="card-title"&gt;Title&lt;/h5&gt;
        &lt;p class="card-text"&gt;Some quick example text to build on the card title and make up the bulk of the card's content.&lt;/p&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How can I solve this?</p>