Font Awesome & Unicode

后端 未结 15 1611
日久生厌
日久生厌 2020-12-04 14:01

I\'m using (the excellent) Font-Awesome in my site, and it\'s working fine, if I use it this way:


B

相关标签:
15条回答
  • 2020-12-04 14:32

    For those who are using Font Awesome version 4.7,

    css_selector::before{
    content:"\f006";
    font-family:"fontawesome";
    font-weight:900;
    }
    
    0 讨论(0)
  • 2020-12-04 14:33

    I got a simillary problem using unicode and fontawesome. when i wrote :

    font-family: 'Font Awesome\ 5 Free';
    content: "\f061"; /* FontAwesome Unicode */
    

    On google chrome, a square appear instead of the icon. The new version of Font Awesome also requires

    font-weight: 900;
    

    That's work for me.

    From : https://github.com/FortAwesome/Font-Awesome/issues/11946

    Hope that's will help.

    0 讨论(0)
  • 2020-12-04 14:35

    You can also use the FontAwesome icon with the CSS3 pseudo selector as shown below.

    Ensure to set the font-family to FontAwesome as shown below:

    table.dataTable thead th.sorting:after {font-family: FontAwesome;}
    

    To get the above working, you must do the following:

    1. Download the FontAwesome css library here FontAwesome v4.7.0
    2. Extract from the zip file and include into your app root folder, the two folders as shown below:
    3. Reference only the css folder in the <head></head> section of your app as shown below:
    0 讨论(0)
  • 2020-12-04 14:36

    Be sure to load the FontAwesome style before yours.

    font-family: "Font Awesome 5 Free";
    font-weight: 400;
    content: "\f007";
    

    You can find FontAwesome's explainations here: https://fontawesome.com/how-to-use/on-the-web/advanced/css-pseudo-elements

    0 讨论(0)
  • 2020-12-04 14:39

    In latest 5.13 there's a difference. You do like always...

    font-family: "Font Awesome 5 Free";
    content: "\f107";
    

    But there's a difference now... Instead of use font-weight: 500; You are following this:

    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    content: "\f107";
    

    Why is that? I figure out by finding in in .fas class, so you can figure out an updated way by looking into .fas class so you're doing the same as it has to be. Figure out if there's a font-weight and font-family. Here you go guys. That's an update answer for 5.13.

    0 讨论(0)
  • 2020-12-04 14:41

    I have found that in Font-Awesome version 5 (free), you have you add: "font-family: Font Awesome\ 5 Free;" only then it seems to be working properly.

    This has worked for me :)

    I hope some finds this helpful

    0 讨论(0)
提交回复
热议问题