Home  >  Q&A  >  body text

css - font awesome的图标为什么显示不出呢


已经很简单了,为啥显示不了呢

迷茫迷茫2742 days ago1354

reply all(5)I'll reply

  • 天蓬老师

    天蓬老师2017-04-17 13:47:38

    Check if there is a 404 in the console. Fontawesome requires the corresponding font file, not just css.


    Make sure the corresponding path file exists

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 13:47:38

    The correct answer upstairs is that font-awesome is not just css, font-awesome requires several corresponding font libraries.
    You can take a look at the source file downloaded from fontAsesome.
    Or you can directly use the css source file of font-Asesome.

    <link rel="stylesheet" href="http://fontawesome.io/assets/font-awesome/css/font-awesome.css">
    $ ls -al css fonts/
    css:
    -rw-r--r-- 1 dong 1049089 35134 9月   8 01:36 font-awesome.css
    -rw-r--r-- 1 dong 1049089 29063 9月   8 01:36 font-awesome.min.css
    
    fonts/:
    -rw-r--r-- 1 dong 1049089 124988 9月   8 01:36 FontAwesome.otf
    -rw-r--r-- 1 dong 1049089  76518 9月   8 01:36 fontawesome-webfont.eot
    -rw-r--r-- 1 dong 1049089 391622 9月   8 01:36 fontawesome-webfont.svg
    -rw-r--r-- 1 dong 1049089 152796 9月   8 01:36 fontawesome-webfont.ttf
    -rw-r--r-- 1 dong 1049089  90412 9月   8 01:36 fontawesome-webfont.woff
    -rw-r--r-- 1 dong 1049089  71896 9月   8 01:36 fontawesome-webfont.woff2

    reply
    0
  • 黄舟

    黄舟2017-04-17 13:47:38

    Stop using font awesome, icon font is much better

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 13:47:38

    It has been verified that it can be displayed. FontAwesome font requires font files. I guess it is caused by not referencing font files. Download the compressed package from github, unzip it locally, and copy the entire fonts file to the corresponding directory. It should be fine. question.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 13:47:38


    Just like this

    reply
    0
  • Cancelreply