Font Awesome 5 字体系列问题 [英] Font Awesome 5 font-family issue
本文介绍了Font Awesome 5 字体系列问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在一个带有 bootstrap 4 的项目中集成了 Font Awesome 5.当我通过 CSS 调用字体时,它不起作用.使用 Font Awesome 4,代码如下:
I integrated Font Awesome 5 in a project with bootstrap 4. When I recall a font via CSS it does not work. with Font Awesome 4 the code was as follows:
#mainNav .navbar-collapse .navbar-sidenav .nav-link-collapse:after {
float: right;
content: "f107";
font-family: "FontAwesome";
}
我尝试更改字体名称,但不起作用
I tried to change the font name but it does not work
font-family: 'Font Awesome 5 Free'
推荐答案
你的 Unicode
错了 f107
a::after {
content: "f007";
font-family: 'Font Awesome 5 Free';
}
<link href="https://use.fontawesome.com/releases/v5.0.1/css/all.css" rel="stylesheet">
<a>User</a>
<i class="fas fa-shopping-basket"></i>
或者在其他情况下,font-weight: 900;
会救你.字体真棒 5 中的某些图标在没有 font-weight: 900;
的情况下无法工作.
Or in other case, font-weight: 900;
will save you. Some icons in font awesome 5 not working without font-weight: 900;
.
a::after {
content: "f007";
font-family: 'Font Awesome 5 Free';
font-weight: 900;
}
这篇关于Font Awesome 5 字体系列问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文