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
  • 75,527
  • 23
  • 147
  • 186
NinjaDeveloper
  • 1,620
  • 3
  • 19
  • 51

3 Answers3

2

You can use vertical-align:

.fa {
  vertical-align: middle;
}

jsFiddle

Or, use flexbox:

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

jsFiddle

Stickers
  • 75,527
  • 23
  • 147
  • 186
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
  • 22,173
  • 7
  • 50
  • 78
1

Flexbox solution

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

Hope this helps.

Gibin Ealias
  • 2,751
  • 5
  • 21
  • 39