Font Awesome 5,为什么CSS内容没有显示?

我正在尝试在CSS的内容中使用FontAwesome。


它与图标而不是图标的代码一起显示。我已关注在线帮助,但仍然无法正常工作


css

  @font-face {

  font-family: 'FontAwesome';

  src: url('https://use.fontawesome.com/releases/v5.0.6/css/all.css'); 

}



.fp-prev:before {

    color:#fff;

    content: '/f35a';

    font-family: FontAwesome;

    font-style: normal;

    font-weight: normal;

    text-decoration: inherit;

}


动漫人物
浏览 909回答 3
3回答

阿晨1998

如果您使用的是JS + SVG版本,请阅读以下内容:使用JS + SVG版本时,Font Awesome 5显示空白首先,您只需使用以下命令在head标签中包含Font 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")然后,您需要更正字体系列和内容,如下所示:@import url("https://use.fontawesome.com/releases/v5.8.1/css/all.css");.fp-prev:before {&nbsp; &nbsp; color:#000;&nbsp; &nbsp; content: '\f35a'; /* You should use \ and not /*/&nbsp; &nbsp; font-family: "Font Awesome 5 Free"; /* This is the correct font-family*/&nbsp; &nbsp; font-style: normal;&nbsp; &nbsp; font-weight: normal;&nbsp; &nbsp; text-decoration: inherit;}<i class="fp-prev"></i>附带说明:Font Awesome 5&nbsp;font-family为每包图标提供3种不同的显示方式:Font Awesome 5 Free&nbsp;免费图标。Font Awesome 5 Brands&nbsp;适用于Facebook,Twitter等品牌图标。@import url("https://use.fontawesome.com/releases/v5.8.1/css/all.css");.fp-prev:before {&nbsp; &nbsp; color:#000;&nbsp; &nbsp; content: "\f099";&nbsp;&nbsp; &nbsp; font-family: "Font Awesome 5 Brands";&nbsp; &nbsp; font-style: normal;&nbsp; &nbsp; font-weight: normal;&nbsp; &nbsp; text-decoration: inherit;}<i class="fp-prev"></i>Font Awesome 5 Pro for the Font Awesome ProIn 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

ibeautiful

做你的font-weight: 900;。我看到你想念它
打开App,查看更多内容
随时随地看视频慕课网APP