Font awesome 5 on pseudo elements

前端 未结 8 2030
面向向阳花
面向向阳花 2020-12-07 12:22

In font awesome 4 you could easily apply an icon to a :before/:after element using CSS.

Is the same possible with the new font awesome 5 JS/SVG implementation? As fr

相关标签:
8条回答
  • 2020-12-07 13:18

    Should you be using Fort Awesome to serve your icons then you need to add font-family: <my-kit-name>, no need to use font-weight: 400/900.

    For more info see this link:

    https://articles.fortawesome.com/how-to-using-fort-awesome-icons-f50ab11a2d2a

    0 讨论(0)
  • 2020-12-07 13:20

    I got 5 to work using

    <link href="https://use.fontawesome.com/releases/v5.0.6/css/all.css" rel="stylesheet">
    

    in <head> and

    :before {
      font-family: "Font Awesome 5 Brands";
      font-weight: 400;
      content: "\f167";
    }
    

    in my css

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