FontAwesome图标在css内容中不起作用

问题描述 投票:0回答:1

我输入以下代码:

a::before {
    content: "\f061";
    font-family: FontAwesome;
} 

但是font-awesome图标没有出现,只是一个空方块。

问题是什么?

谢谢!

font-awesome
1个回答
0
投票

来自This answer@TemaniAfif可能会有帮助。

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css">
@import url("https://use.fontawesome.com/releases/v5.2.0/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;
}
© www.soinside.com 2019 - 2024. All rights reserved.