40

I've been searching in the examples on the GitHub but I couldn't find how to load a simple css file into my layout. My first thought was doing something like this link(href="my.css") but it seems it's not working at all. The href points to a correct location online (checked and working) thus maybe I'm forgetting something?

1
  • What does the generated HTML look like?
    – thejh
    Oct 31, 2011 at 15:52

5 Answers 5

97

try: link(rel='stylesheet', href='/stylesheets/style.css')

0
13

I think you need to include the relationship. Try

link(rel='stylesheet', href='my.css')

13

This works:

html
    head
        style
             include ./style.css
    body
10

You need to add the type:

link(rel='stylesheet', href='my.css', type='text/css' )
3

if you're using Jade with connect-assets, you can just use:

!= css('stylesheetName')

where stylesheetName.css is in your assets/css/ directory.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.