You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

静态站点中Font Awesome 5品牌图标无法正常显示求助

Fixing Font Awesome 5 Branded Icons Not Displaying

Got it, let's sort out why your branded Font Awesome 5 icons aren't showing up. The issue here is pretty straightforward—you're missing the dedicated CSS file for branded icons, and you need to make sure you're using the right class syntax for them.

Here's what you need to do:

  1. Add the Brands CSS file to your head section
    Branded icons (like Facebook, Twitter, GitHub, etc.) are packaged separately from the Solid style icons you've already loaded. You'll need to include the Brands CSS file that matches your existing v5.0.8 version. Add this line right after your existing Font Awesome links:

    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.8/css/brands.css" integrity="sha384-IiIL1/ODJBRTrDTFk/pW8j0DUI5/z9m1KYsTm/RjZTNV8RHLGZXkUDwgRRbbQ+Jh" crossorigin="anonymous">
    
  2. Use the correct icon class syntax
    Branded icons require the fab (Font Awesome Brands) prefix instead of the fas (Font Awesome Solid) prefix you'd use for solid icons. For example:

    • Correct: <i class="fab fa-twitter"></i>
    • Wrong: <i class="fas fa-twitter"></i>
  3. Verify no loading errors
    Pop open your browser's developer tools (F12) and check the Console tab for any 404 errors related to the Brands CSS file. If you see one, double-check the URL integrity and make sure it's matching the v5.0.8 release exactly.

Once you add the Brands CSS and use the right class prefix, those branded icons should render properly!

内容的提问来源于stack exchange,提问作者Tithos

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 04:08:26