【问题标题】:Vertically aligning two FontAwesome icons垂直对齐两个 FontAwesome 图标
【发布时间】:2020-12-30 11:49:47
【问题描述】:

我有一些简单的代码,其中包括来自 FontAwesome 的两个字体图标。

它们在我的浏览器中呈现如下:

请注意,虽然两个元素的高度都是 16 像素,但两个图标没有垂直对齐,日历的位置低于

<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>

我可以在六边形上使用bottom: -1px;“修复”,但有没有更好的方法来对齐基线?

【问题讨论】:

    标签: font-awesome vertical-alignment font-awesome-5


    【解决方案1】:

    这似乎是字体本身定义的字形的问题

    猜你喜欢
    • 2019-06-05
    • 2020-11-08
    • 1970-01-01
    • 1970-01-01
    • 2020-12-14
    • 1970-01-01
    • 1970-01-01
    • 2015-10-14
    • 2013-09-23
    相关资源
    最近更新 更多