pugfont-awesome

How to add FontAwesome Icons in Jade


How can I add a FontAwesome icon to an a tag in Jade/Pug? I would also like to make it bold. Thanks in advance! This is what I've tried:

a(href="#toTop", class="fa fa-arrow-up", aria-hidden="true")

Solution

  • You need to do it this way

    a(href='#')
      i.fa.fa-arrow-up(aria-hidden='true') 
    

    To add icons, you need to give the font-awesome classes to i tag and it should be inside of a tag. Now you can apply the CSS and make it bold

    Do not forget to add the font-awesome CDN.

    Hope this helps.