Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font-awesome icons are not vertically centered

I'm using the latest font-awesome library (4.4) and it seems some icons are not vertically centered or they have different sizes.

Reproduction online

I made a zoom over a font-size: 14px; list here:

enter image description here

Is there anything I'm doing wrong?

like image 225
Alvaro Avatar asked Oct 15 '25 18:10

Alvaro


2 Answers

.quick-actions i {
    font-size: 54px;
    cursor: pointer;
    color: #999;
    vertical-align: middle;
}
.fa:before {
    vertical-align: middle;
}
.quick-actions{
    border:1px solid #ccc;
    display: inline-block;
}

This seems to work... http://jsfiddle.net/nh1sgw1a/

Edit (I see it really is a problem with fa-commenting-o):

.quick-actions i.fa-commenting-o:before{
    font-size:50px;
    /*margin-top:-5px;*/
    float:left;
}

http://jsfiddle.net/nh1sgw1a/2/

like image 183
Madalina Taina Avatar answered Oct 17 '25 14:10

Madalina Taina


Like said in the comments, they aren't drawn centered in the middle of the horizontal axis of its shape, and that's why they look like being in different heights. That said, I found this CSS rule useful to place them closer to the middle edge of my buttons/bars (more vertically centered, although not perfect):

i.fa {
  vertical-align: middle;
}
like image 33
chimos Avatar answered Oct 17 '25 15:10

chimos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!