问题
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:
- Download the font awesome free zip from the official site
- there is a folder called 'css', copy that folder into your project folder, (important) and also copy the folder named 'webfonts'
- then link the desired css file to html file (all.css or fontawesome.css or fontawesome.min.css) using the command
- 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