Alex Riskus Alex Riskus - 11 months ago 67
CSS Question

Express.js can't get my CSS files

app.use(express.static(path.join(__dirname, '/public')));

I can't get my CSS files using Express.js but it works using the links.

title Welcome
link(rel='stylesheet' src='/css/bootstrap.css')
link(rel='stylesheet' src='/css/bootstrap-theme.css')
script(type='text/javascript' src='/javascripts/jquery.js')
script(type='text/javascript' src='/javascripts/bootstrap.js')
input(type='submit' class='btn btn-success')
h1 Users
- each name in names
p= 'Username: ' +

Answer Source

Try using the following syntax for including css:

link(rel='stylesheet', href='/css/bootstrap.css')

Just as an html style tag takes an href attribute, so does link within jade.