Font Awesome 5.0.13 CSS 错误
Font Awesome 5.0.13 CSS error
我使用的是 font awesome 5.0.13 最新版本,但 Unicode 字符在我的 css 中不起作用。请告诉我哪里错了。
nav.socials ul li a:before{
font-family: 'Font Awesome\ 5 Free';
display: inline-block;
vertical-align: top;
padding: 0 5px;
content: "\f08e";
}
你试过的content
在版本5中被替换。
看这里:https://fontawesome.com/icons/external-link-alt?style=solid
你必须在 Font Awesome 5
中设置 font-weight
所以这是一个工作:
a::before{
font-family: 'Font Awesome 5 Free';
font-weight: 900;
content: "\f35d";
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<a href="#">try</a>
我使用的是 font awesome 5.0.13 最新版本,但 Unicode 字符在我的 css 中不起作用。请告诉我哪里错了。
nav.socials ul li a:before{
font-family: 'Font Awesome\ 5 Free';
display: inline-block;
vertical-align: top;
padding: 0 5px;
content: "\f08e";
}
你试过的content
在版本5中被替换。
看这里:https://fontawesome.com/icons/external-link-alt?style=solid
你必须在 Font Awesome 5
中设置 font-weight
所以这是一个工作:
a::before{
font-family: 'Font Awesome 5 Free';
font-weight: 900;
content: "\f35d";
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<a href="#">try</a>