本文介绍了Font Awesome 5字体家族问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在带有引导程序4的项目中集成了Font Awesome5.当我通过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;将保存您.如果没有font-weight: 900;,字体5中的某些图标将无法正常工作.

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字体家族问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 10:12