I’m using jade for templating within my node.js/express app. but when i try to using font awesome the icons don’t show, only list bullets. I’ve tried all methods i’ve found by search engine. such as fa.fa-globe issue.
here’s is the code taken from the footer.jade
span This is some other footer stuff.
ul
li.fa.fa-google-plus
a(href='#')
i.fa.fa-facebook
li
a(href='#')
i.fa.fa-lg.fa-twitter
li
a(href='#')
i.fa.fa-lg.fa-google-plus
li
a(href='#')
span.fa.fa-lg.fa-linkedin
span and some more footer stuff.
As you can see above there are various methods i’ve tried, i, span and classes
And my layout.jade is as follows:
doctype html
html
head
title= title
meta(name='viewport', content='width=device-width, initial-scale=1.0')
link(href='https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.5/darkly/bootstrap.css', rel='stylesheet', media='screen')
link(href='http://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css')
link(rel='stylesheet', href='/stylesheets/style.css')
include ./header.jade
body(style="padding-bottom:10rem;")
block content
script(src='http://code.jquery.com/jquery.js')
script(src='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js')
thanks
2
Answers
The main issue is that you’re missing the
rel='stylesheet'
attribute for the font-awesome<link>
. That will get the font-awesome icons working.However if you’re trying to get the icons to replace the bullets in the list, you’ll need to tweak your footer’s list items as shown on the font-awesome examples page. For example:
If you’re seeing an empty symbol where the icon should be, you may need to add encoding to your layout head: