I have created a simple alert using Bootstrap 4. For some reason I can't get the text in my message to align with the top of the (i) icon. I've tried setting margins and padding to 0 on the div but nothing works. Can someone explain how to fix this? I would like the top of the text to align with the top of the icon IN the card, and the card to be centered vertically and horizontally.
Code is below:
<div class="container">
<div class="row">
<div class="col-sm-9 col-md-10">
<div class="panel panel-default">
<div class="panel-body">
<div class="col-xs-12 alert alert-info">
<i class="fa fa-info-circle fa-3x" aria-hidden="true"></i>
<div class="pt-0 mt-0">
My message here. Lots of text for several lines! My message here. Lots of text for several lines! My message here. Lots of
text for several lines! My message here. Lots of text for several lines!
</div>
</div>
</div>
</div>
</div>
</div>
</div>
I tried pt-0 and mt-0 but they have no effect
UPDATE: As pointed out below PANEL should be replaced with CARD. I can get close with answer below:
<div class="container">
<div class="row justify-content-center h-100">
<div class="col-sm-9 col-md-10 my-auto">
<div class="card border-0">
<div class="card-block">
<div class="col-xs-12 alert alert-info">
<i class="fa fa-info-circle fa-3x float-left mr-2" aria-hidden="true"></i>
<div>
My message here. Lots of text for several lines! My message here. Lots of text for several lines! My message here. Lots of
text for several lines! My message here. Lots of text for several lines!
</div>
</div>
</div>
</div>
</div>
</div>
</div>
But can't get it to center the entire card vertically as described in this SO answer