How to align the content of a card to the center?

Asked

Viewed 32 times

1

The card contains an icon and a title.

I intend to align both in the center (horizontally and vertically). It is not enough to use the class text-center?

<div class="card bg-green p-1 w-100" style='height:12em'>
    <div class="mt-3 icon text-center">
      {{post.icon}} 
    </div>
    
    <div class="card-body title text-center">
        <h5 class="card-title"> 
          {% if post.size %}
          <span style="font-size:{{post.size}} text size big">{{post.title}}</span>
          {%else %}
          {{post.title}} {{post.subtitle}}
          {% endif %}
        </h5>
    </div>
         
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.