2

I am using a Font Awesome icon in the modal of success. I want to make the icon bigger, the problem is the text is no longer vertically centered if I do that.

enter image description here

<div class="alert alert-success alert-dismissible">
  <span class="fa fa-check-circle" aria-hidden="true" style="font-size: 32px;"></span>
  <strong> You have successfully set up an administration for this client.</strong>
</div>
Stickers
  • 70,124
  • 20
  • 133
  • 171
NinjaDeveloper
  • 1,409
  • 3
  • 16
  • 46

3 Answers3

2

You can use vertical-align:

.fa {
  vertical-align: middle;
}

jsFiddle

Or, use flexbox:

.alert {
  display: flex;
  align-items: center;
}

jsFiddle

Stickers
  • 70,124
  • 20
  • 133
  • 171
1

Have a look at Text alignment - class="text-center" and class="align-middle"

 <div class="alert alert-success alert-dismissible text-center">
     <span class="fa fa-check-circle" aria-hidden="true" style="font-size: 32px;"></span>
     <strong class="align-middle"> You have successfully set up an administration for this client.</strong>
  </div>
Gildas.Tambo
  • 21,175
  • 7
  • 48
  • 76
1

Flexbox solution

.alert{
  display: flex;
  align-items: center;
}

Hope this helps.

Gibin Ealias
  • 2,571
  • 4
  • 20
  • 37