Rainier laan
Rainier laan

Reputation: 1130

Font-awesome 5 not working

I decided it was time for me to switch to Font-awesome 5 when I ran into a problem. My icons are not shown. It shows me this. enter image description here

I don't get where the problem occurs. I followed every step on their site and linked the files correctly but they still dont show. Here is a screenshot of the file.

enter image description here

What is causing this? Why doesn't it work?

Upvotes: 1

Views: 12888

Answers (8)

Brik
Brik

Reputation: 83

lets add all.min.css to css directory then link it

<link rel="stylesheet" href="/css/all.min.css">

and make webfonts directory beside all the main folders

Upvotes: 5

Udhaya Kumar
Udhaya Kumar

Reputation: 1

An simple solution.

  1. Download the files from #fontawesome for #web

Download the files from #fontawesome for #web

  1. Your html

Your html

  1. Your browser screen

Your browser screen

Upvotes: 0

Jim
Jim

Reputation: 622

I had the same problem. I had a directory called fontawesome into which I put fontawesome-all.css and the webfonts directory.

I simply changed it to placing the directory structure by adding a subdirectory css, moving the .css file to it and changing the link to include the subdirectory.

Works perfectly now.

Upvotes: 0

MBaas
MBaas

Reputation: 7538

I see that you're getting the .CSS from /fontawesome. FA will then try to load its fonts from /webfonts - I assume this does not exist.

I'd recommend to stick with FA's folder-structure. Move the .CSS to /fontawesome/css and make sure you copy the webfonts-with-css/webfonts-folder into /fontawesome/webfonts.

Upvotes: 0

Ibrahim Haouari
Ibrahim Haouari

Reputation: 250

your problem is 'fa' and not 'fas'

<i class="fa fa-camera-retro fa-10x" ></i>

Upvotes: -1

Azeez Kallayi
Azeez Kallayi

Reputation: 2642

You can use cdn link for fontawsome,its a better way. Please see the below code, it may help you

<link href="https://use.fontawesome.com/releases/v5.0.4/css/all.css" rel="stylesheet">
<i class="fa fa-camera-retro fa-10x" ></i>

Upvotes: 4

Amine Hadj Abdallah
Amine Hadj Abdallah

Reputation: 1

it's <i class="fa fa-camera-retro fa-10x" ></i> not <i class="fas fa-camera-retro fa-10x" ></i> </pre>

Upvotes: -1

Daniel Vilas-Boas
Daniel Vilas-Boas

Reputation: 896

Try to use the absolute path by adding another / in the start of your import methods.

Are you sure that you only need to import the minified css? You might need to import the fonts too.

The error on your console shows that the problem you're facing is import related.

Upvotes: 0

Related Questions