Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

font awesome - Vertically aligning two FontAwesome icons

I have some simple code which includes two font icons from FontAwesome.

They render like this in my browser:

Side by side example of two icons

Note that although both elements are 16px in height, the two icons are not vertically aligned, the calendar rests lower down than the

Screenshot showing gap

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://pro.fontawesome.com/releases/v5.15.1/css/all.css" rel="stylesheet"/>


<p>
  <i class="fad fa-times-hexagon text-danger fa-fw"></i>
  <i class="fad fa-fw fa-calendar"></i>
</p>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This would appear to be a problem with the glyphs defined in the font itself

calendar secondary glyph

hexagon secondary glyph


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...