Here are the basics on Font Awesome icons and how to add them to your web projects.
You can place Font Awesome icons just about anywhere. We've tried to make it so that icons will take on the characteristics and blend in with surrounding text naturally.
To add an icon, you need to know two bits of information:
- the shorthand class name for the style you want to use
- the icon name, prefixed with
fa-(meaning "font awesome" naturally!)
There are 6 styles of Font Awesome - Each has a unique class name and font-weight:
|Style||Availability||Style class||@font-face weight||Looks like|
|Solid||Free Plan|| ||900|
|Regular||Pro Plans only|| ||400|
|Light||Pro Plans only|| ||300|
|Thin||Pro Plans only|| ||100|
|Duotone||Pro Plans only|| ||900|
|Brands||Free Plan|| ||400|
# Add Icons to HTML
Font Awesome is designed to be used with inline elements and we recommend that you stick with a consistent element in your project. We recommend using
<i> element with the Font Awesome CSS classes for the style class for the style of icon you want to use, and the icon name class with the
fa- prefix for the icon you want to use.
Here's an example:
<!-- This example uses <i> element with: 1. the `fa-solid` style class for solid style 2. the `user` icon with the `fa-` prefix --> <i class="fa-solid fa-user"></i> <!-- Or you can use a <span> element, with classes applied in the same way --> <span class="fa-solid fa-user"></span>
We've updated many of our icon names in version 6 to make them more universal and consistent. But we wanted to make sure not to break your existing code so we made aliases for renamed icons that will allow them to work with either the old or new names.
And you can use the old or new name for styles as well. So you can still use
fab, and have
fat be the new Thin!
<!-- All of these code snippets will render the same icon thanks to aliases. --> <i class="fa-solid fa-cutlery"></i> <i class="fa-solid fa-utensils"></i> <i class="fas fa-utensils"></i>
# Alternate Ways to Add Icons
We also have a number of other ways to add Font Awesome icons, in case your situation calls for something specific: