Recently I\'ve been developing this website and I\'m trying to put a font awesome icons in it, so it\'s scalable.
The thing is they are not showing up.
Look
Try the below two links keep in header tag.
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
Getting the Icons from the below link :
<link rel="stylesheet" href="http://fortawesome.github.io/Font-Awesome/3.2.1/assets/font-awesome/css/font-awesome.css">
At first I couldn't get this to work with Font Awesome 5:
<i class="fa fa-sort-down"></i>
That's why I came here, being unfamiliar with font awesome. So when I looked further I noticed that my issue was merely an issue with the version.
w3schools helped me out in this case.
New in Font Awesome 5 is the
fas
prefix, Font Awesome 4 usesfa
.The s in
fas
stands for solid, and some icons also have a regular mode, specified by using the prefixfar
.
I already noticed the different files in the FontAwesome css folder, like:
And that's when I realized my mistake. All I had to do was include the appropriate css to the html:
<link rel="stylesheet" href="~/lib/Font-Awesome/css/fontawesome.min.css">
<link rel="stylesheet" href="~/lib/Font-Awesome/css/regular.min.css">
<link rel="stylesheet" href="~/lib/Font-Awesome/css/solid.min.css">
And then reference the correct item:
<i class="fas fa-sort-down"></i>
This setup works for me. Though not all items have equivalents in each type. This will not work:
<i class="far fa-sort-down"></i>
As a side note, when you don't want to reference all seperate files then this will suffice:
<link rel="stylesheet" href="~/lib/Font-Awesome/css/fontawesome.min.css">
<link rel="stylesheet" href="~/lib/Font-Awesome/css/all.min.css">
To whoever may be checking this out in 2018. I am using font awesome 4.7.0 and I got this issue solved by simply taking out the s
in fas
as seen in the code <i class="fa fa-[icon-name]"></i>
. This was originally <i class="fas fa-[icon-name]"></i>
.
Hope this helps.
Mine was not working because I wanted an icon which was not released in the FA version I was using.
This answers why some icons shows but others no.
Pretty obvious but I guess some people still fall for this. Like me.
Use this link:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/brands.min.css" integrity="sha512-AMDXrE+qaoUHsd0DXQJr5dL4m5xmpkGLxXZQik2TvR2VCVKT/XRPQ4e/LTnwl84mCv+eFm92UG6ErWDtGM/Q5Q==" crossorigin="anonymous" />
You must use https for maxcdn.bootstrapcdn.com. Only https on maxcdn support CORS
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet" media="screen" />