【问题标题】:how do you link css to a jade file?你如何将css链接到jade文件?
【发布时间】:2013-12-13 22:33:16
【问题描述】:

我目前正在尝试链接normalize.css,但它不工作(使用套接字快递)

html
        head
                title= "Real time web chat"
                link(href='/css/normalize.css')
                script(src='/chat.js')
                script(src='/socket.io/socket.io.js')
                script(src='http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js')
        body
                #content(style='width: 100%; height: 600px; margin: 0 0 20px 0; border: solid 1px #999; overflow-y: scroll;')
                .controls
                        | Name: 
                        input#name(style='width:350px;')

                        input#field(style='width:350px; display: inline; margin-left -90px;')
                        input#send(type='button', value='send')

【问题讨论】:

    标签: css node.js express pug


    【解决方案1】:

    你需要rel

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

    【讨论】:

    • 当我查看源代码时,它显示“Cannot GET /css/normalize.css”
    • 那你可能走错了路。如果您使用 express 默认文件夹模板,normalize.css 应该在 `public/css/' 中。
    • 谢谢我把它放在我自己创建的 CSS 文件夹中
    • rel=stylesheet 是我的解决方案。谢谢
    猜你喜欢
    • 2017-01-13
    • 1970-01-01
    • 2014-02-04
    • 1970-01-01
    • 2020-08-31
    • 2020-11-01
    • 2014-05-27
    • 1970-01-01
    相关资源
    最近更新 更多