0

Why Material-icons cannot set vertical align middle with text even though exactly same css of Font-Awesome? (with Bootstrap3)

Both of them has &:before { content: '{icontext}' }

image: Left: Material-icons / Right: Font-Awesome

<a class="btn btn-default">  
  <i class="material-icons"></i>  
  <i class="fa fa-bookmark"></i>
  123
</a>

.material-icons {
    display: inline-block;
    font: normal normal normal 14px/1 'Material Icons';
    font-size: inherit;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.fa {
    display: inline-block;
    font: normal normal normal 14px/1 FontAwesome;
    font-size: inherit;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

edit:

attached jsfiddle https://jsfiddle.net/laires/guxwxvzL/

2 Answers2

0

Try to add vertical-align: middle in .material-icons { ... }

0

Here an example with different line-height and paddings.

I add the class vertical-align: middle; in .material-icons.

The code:

https://jsfiddle.net/rafalito1989/yutqc2xL/

hope you helpful