这个问题在这里已有答案:
我在成功的模式中使用了Font Awesome图标。我想让图标更大,问题是如果我这样做,文本不再垂直居中。
<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>
看看Text alignment - class="text-center" 和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>
Flexbox解决方案
.alert{
display: flex;
align-items: center;
}
希望这可以帮助。