Font Awesome 5 font-family issue

前端 未结 16 2806
深忆病人
深忆病人 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 14:48

    I didn't want to use the 'all' version, so searched the 'fontawesome-all.min.css' file (previously included in the header) for 'family' tag and found at the end a declaration @font-face{font-family:**Font Awesome\ 5 Free**;font-style:normal;

    So, in the stylesheet for an element where I wanted to use the content: "\f0c8"; code, I've added (or changed to) font-family: Font Awesome\ 5 Free; and it worked.

    .frb input[type="checkbox"] ~ label:before {
        font-family: Font Awesome\ 5 Free;
        content: "\f0c8";
        font-weight: 900;
        position: absolute;
    }
    

提交回复
热议问题