Font Awesome Icons in Offline

拥有回忆 提交于 2020-01-11 09:43:09

问题


Is there any way to use this in offline?

 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

I copy the link and save as font-awesome.min.css but still it is not working in offline like this link href="css/font-awesome.min.css" rel="stylesheet" type="text/css"


回答1:


Press the "Download free" button and make sure that you have the webfonts too. There is a web-fonts-with-css folder in the downloaded zip. Copy the fonts in your project and modify the paths for the fonts in your CSS to point to the location of the webfonts.

If you open the CSS linked in your questions you'll see that they have some imports with

url('../fonts/fontawesome-webfont.woff2?v=4.7.0')

modify these with the location of the fonts downloaded.




回答2:


  1. Download the font awesome free zip from the official site
  2. there is a folder called 'css', copy that folder into your project folder, (important) and also copy the folder named 'webfonts'
  3. then link the desired css file to html file (all.css or fontawesome.css or fontawesome.min.css) using the command
  4. then try your code, it will work



回答3:


The Fontawesome website itself documents how to download and use the icon kit offline here: https://fontawesome.com/how-to-use/on-the-web/setup/hosting-font-awesome-yourself



来源:https://stackoverflow.com/questions/49550011/font-awesome-icons-in-offline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!