RRR uzumaki
RRR uzumaki

Reputation: 1328

Adding Font Awesome icons in the ejs file in Nodejs (with express js) project

Hey guys i am trying to build a comment system project with Nodejs . At a certain place i want to use Font Awesome icons in my project so i tries 2 ways but failed to render thoses icons

First

inclucing

<link href="https://stackpath.bootstrapcdn.com/.../font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" 
    crossorigin="anonymous">

inside my head tag in ejs file and then

Second

Download this zip file https://fontawesome.com/how-to-use/on-the-web/setup/hosting-font-awesome-yourself

and open the CSS folder inside and drag the all.min.css file into your public directory in your project. and then Use a link tag to reference it in your templates/HTML, e.g:

and

Both the ways failed, am i missing something ?

Upvotes: 2

Views: 5310

Answers (1)

Stephen S
Stephen S

Reputation: 3994

Since you are using the font-awesome solid styles with the fas class, you'll have to include the solid.css styles.

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/solid.min.css">

Upvotes: 2

Related Questions