css - font awesome的图标为什么显示不出呢
迷茫
迷茫 2017-04-17 13:45:38
0
5
1353


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

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

répondre à tous(5)
Peter_Zhu

console里看看有没有404,fontawesome 需要对应的字体文件,并不只是css。


确保对应的路径文件存在

巴扎黑

楼上正解,font-awesome不仅仅是css,font-awesome需要几个相应字体库。
可以看一下从fontAsesome上下载下来的源文件。
或者可以直接用font-Asesome的css源文件。

<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
黄舟

别用font awesome了,icon font别这个好多了

大家讲道理

经验证是可以显示的,FontAwesome字体需要字体文件,我估计你是没有引用字体文件导致的,从github上下载压缩包,解压到本地,把fonts整个文件拷贝到相应目录,应该就没问题。

伊谢尔伦


像这样就可以了

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!