我目前對在CSS偽元素中使用圖標(biāo)感到困惑。有4種字體家庭為fontawesome: ,F(xiàn)ont Awesome 5 Free,,F(xiàn)ont Awesome 5 SolidFont Awesome 5 BrandsFont Awesome 5 Regular這是HTML:<h1>Hello</h1>情況1我使用以下圖標(biāo):https : //fontawesome.com/icons/twitter?style=brands如您所見,它是一個brands圖標(biāo),所以font-family:Font Awesome 5 Brandsh1:before { display: inline-block; font-style: normal; font-variant: normal; text-rendering: auto; -webkit-font-smoothing: antialiased; content: "\f099"; /* TWITTER ICON */ font-family: "Font Awesome 5 Brands"; font-weight: 400;}有用!情況二我使用以下圖標(biāo):https : //fontawesome.com/icons/phone?style=solid如您所見,它是一個solid圖標(biāo),所以font-family:Font Awesome 5 Solidh1:before { display: inline-block; font-style: normal; font-variant: normal; text-rendering: auto; -webkit-font-smoothing: antialiased; content: "\f095"; /* PHONE ICON */ font-family: "Font Awesome 5 Solid"; font-weight: 900;}不工作!我做錯了什么?我們?nèi)绾沃篮螘r使用正確的字體系列?
Font Awesome 5-在CSS偽元素中選擇正確的字體系列
ibeautiful
2019-09-27 15:38:02