Html Font Awesome 无法在离线模式下工作
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30832649/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Font Awesome not working in offline mode
提问by Mehar
i am using font-awesomeicons for publishing my HTML,CSS templates. They are working fine when i have the live link but when i download the CSS file and include that in my pages icon disappears.
我正在使用字体很棒的图标来发布我的 HTML、CSS 模板。当我有实时链接时,它们工作正常,但是当我下载 CSS 文件并将其包含在我的页面中时,图标消失了。
Live Path : <link href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
实时路径: <link href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
Local Path : <link href="css/font-awesome.css" rel="stylesheet">
本地路径: <link href="css/font-awesome.css" rel="stylesheet">
How can i use the font awesome in offline mode?
如何在离线模式下使用字体真棒?
采纳答案by nikola_wd
You also need to download the fonts themselves as well...It is a font, like any other...So, go to fontawesome website, follow the instructions and download css + fonts :)
您还需要自己下载字体...它是一种字体,就像任何其他字体一样...所以,去 fontawesome 网站,按照说明下载 css + fonts :)
回答by Mohammad Javad Akbari Eidgahi
Did you embed FontAwesome font into your project? your structure must be like this:
您是否将 FontAwesome 字体嵌入到您的项目中?你的结构必须是这样的:
[+]assets
[+]css
font-awesome.css
[+]js
demo-file.js
[+]fonts
fontawesome-webfont.eot
fontawesome-webfont.svg
fontawesome-webfont.ttf
fontawesome-webfont.woff
fontawesome-webfont.woff2
index.html
sample.html
whatever.html
after that, you can use FontAwesome locally.
之后,您就可以在本地使用 FontAwesome。
回答by scaisEdge
Could be a pathname problem Try:
可能是路径名问题尝试:
<link href="./css/font-awesome.css" rel="stylesheet">
回答by Viet Tran
I think you didn't download fonts or you used the wrong path. You can download the latest version font awesome at https://fontawesome.com/download. And don't forget check your path!
我认为您没有下载字体或使用了错误的路径。您可以在https://fontawesome.com/download下载最新版本的字体真棒。并且不要忘记检查您的路径!
Hope this helps.
希望这可以帮助。