Font Awesome 5 font-family issue

前端 未结 16 2796
深忆病人
深忆病人 2020-12-12 14:31

I integrated Font Awesome 5 in a project with bootstrap 4. When I recall a font via CSS it does not work. with Font Awesome 4 the code was as follows:

#mainN         


        
16条回答
  •  我在风中等你
    2020-12-12 15:06

    Since FontAwesome 5, you have to enable a new "searchPseudoElements" option to use FontAwesome icons this way:

    
    

    See also this question: Font awesome 5 on pseudo elements and the new Font Awesome API: https://fontawesome.com/how-to-use/font-awesome-api

    Additionaly, change font-family in your CSS code to

    font-family: "Font Awesome 5 Regular";
    

提交回复
热议问题