I can't figure out how to get my text to align with the middle of my icon. This is using Chrome. See this fiddle.
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');
.row {
background: #f8f9fa;
margin-top: 20px;
}
.col {
border: solid 1px #6c757d;
padding: 10px;
}
<link href="//stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet" />
<label class="badge badge-secondary align-middle">
<span class="pb-2">Should Be Centered</span>
<i class="material-icons md-18">cancel</i>
</label>
Any suggestion is welcome!
Example image:
You'd want to put align-middle
on the badge contents, instead of the badge
...
<label class="badge badge-secondary">
<span class="pb-2 align-middle">Should Be Centered</span>
<i class="material-icons md-18 align-middle">cancel</i>
</label>
Demo with MD icon: https://www.codeply.com/go/TkAEvkUcXB
You can Bootstrap Flex utilities to happen this.
<label class="badge badge-secondary d-inline-flex align-items-center justify-content-start">
<span>Should Be Centered</span>
<i class="material-icons md-18">cancel</i>
</label>
Codepen example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With