0

This is probably a rookie question but I'm stuck with this and have gone through the troubleshooting steps here.

I am using a local copy of fontawesome-all.min.css in my assets which I have imported in main.css as follows:

@import url(fontawesome-all.min.css);

The fontawesome-all.min.css has the fonts I am looking for fa-envelope and fa-graduation-cap. However, when I use them on my webpage, fa-envelope renders but fa-graduation-cap doesn't. Where am I going wrong?

<li><a href="#" class="fa-envelope"><span class="label">Email</span></a></li>
<li><a href="#" class="fa-graduation-cap"><span class="label">Google Scholar</span></a></li>
Vishakha Lall
  • 1,178
  • 12
  • 33
  • I had similar issue in the past. please mention your font-awesome version and check if this tag is available in your version. In new version some icons are coming with fab- mix. – Khurram Shaikh Jan 12 '21 at 07:04

2 Answers2

1

Don't add the class on the a tag. Add font-awesome classes inside a <i> tag, like given below:

<li><a href="#"><i class="fas fa-envelope"></i> <span class="label">Email</span></a></li>
<li><a href="#"><i class="fas fa-graduation-cap"></i><span class="label">Google Scholar</span></a></li>

Codepen: https://codepen.io/manaskhandelwal1/pen/NWROWmZ


If you don't have the latest version you can either download this file or use directly also inside the link tag: https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css


To get the latest versions classes, visit the official documentation here and just search the icon there and click on it to find all details about it: https://fontawesome.com/icons?d=gallery

Manas Khandelwal
  • 3,790
  • 2
  • 11
  • 24
0

fa and fas is missing

<ul>
<li><a href="#" class="fa fa-envelope"><span class="label">Email</span></a></li>
<li><a href="#" class="fas fa-graduation-cap"><span class="label">Google Scholar</span></a></li>
</ul>
Khurram Shaikh
  • 300
  • 2
  • 14