Search code examples
htmlcssunicodeiconsfont-awesome

How do I find the Unicode value for a FontAwesome icon?


I'm wanting to be able to do something like this:

 button.accordion:after {
    font-family: FontAwesome;
    content: "\f150";
    font-family: "fontawesome";
    font-size: 18px;
    float: right;
  }

But I'm not sure how to find the unicode value.

There are some similar questions on here, but they are super convoluted. I'm just wondering if there is a practical way to find the Unicode value of an icon without Javascript to add into my CSS.


Solution

  • When you go to the font-awesome website, you see the search option. You can find your icon, and as shown in the screenshot you can get the Unicode for any icon.

    Unicode example

    If you want to add an icon's Unicode in a CSS file, first you have to download the icon on your PC and in all.min.css you will find the .ttf file. You have to replace their file path with your path. And then you can use icons on your website.