pugjs(jade) template engine loading css file

前端 未结 5 1582
南方客
南方客 2020-12-25 11:30

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 li

相关标签:
5条回答
  • 2020-12-25 12:05

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

    0 讨论(0)
  • 2020-12-25 12:10

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

    != css('stylesheetName')
    

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

    0 讨论(0)
  • 2020-12-25 12:11

    I think you need to include the relationship. Try

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

    0 讨论(0)
  • 2020-12-25 12:22

    This works:

    html
        head
            style
                 include ./style.css
        body
    
    0 讨论(0)
  • 2020-12-25 12:25

    You need to add the type:

    link(rel='stylesheet', href='my.css', type='text/css' )
    
    0 讨论(0)
提交回复
热议问题