3 回答

TA貢獻(xiàn)2037條經(jīng)驗(yàn) 獲得超6個(gè)贊
如果您使用的是JS + SVG版本,請(qǐng)閱讀以下內(nèi)容:使用JS + SVG版本時(shí),F(xiàn)ont Awesome 5顯示空白
首先,您只需使用以下命令在head標(biāo)簽中包含F(xiàn)ont Awesome 5的CSS文件:
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css">
或在CSS文件中:
@import url("https://use.fontawesome.com/releases/v5.8.1/css/all.css")
然后,您需要更正字體系列和內(nèi)容,如下所示:
@import url("https://use.fontawesome.com/releases/v5.8.1/css/all.css");
.fp-prev:before {
color:#000;
content: '\f35a'; /* You should use \ and not /*/
font-family: "Font Awesome 5 Free"; /* This is the correct font-family*/
font-style: normal;
font-weight: normal;
text-decoration: inherit;
}
<i class="fp-prev"></i>
附帶說(shuō)明:Font Awesome 5 font-family
為每包圖標(biāo)提供3種不同的顯示方式:
Font Awesome 5 Free
免費(fèi)圖標(biāo)。
Font Awesome 5 Brands
適用于Facebook,Twitter等品牌圖標(biāo)。
@import url("https://use.fontawesome.com/releases/v5.8.1/css/all.css");
.fp-prev:before {
color:#000;
content: "\f099";
font-family: "Font Awesome 5 Brands";
font-style: normal;
font-weight: normal;
text-decoration: inherit;
}
<i class="fp-prev"></i>
Font Awesome 5 Pro for the Font Awesome Pro
In some cases, you have to adjust the value of the font-weight like detailed here: Font Awesome 5 on pseudo elements shows square instead of icon
添加回答
舉報(bào)