簡體   English   中英

使用Express和Jade在Node-js服務器中不顯示背景圖像

[英]Background Image not displaying in node-js server using express and Jade

我正在使用nodejs-express-jade創建一個較小的項目。

我的index.jade文件顯示為:

html
    head
        title= title
    body
        link(rel='stylesheet', href='/stylesheets/style.css')
        #login-container
        form( method="post")#login-form.well.span4
            h1 Welcome
            p.subheading Please Login To Your Account
            label Username 
            input(type="text", name="user", id='user-tf').span4.required
            label Password
            input(type="password", name="pass", id='pass-tf').span4.required
            button(type="submit")#btn-login.btn.btn-primary
                i.icon-lock.icon-white
                | Sign in
            div.clear-fix

我的樣式表style.css具有:

body {
  padding: 300px;
  font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
  background-color:black; 
  background-image: url("C:/Users/nrao/Desktop/nodejs/npm-1.4.6/KrishiMoney/image.jpg");
}

a {
  color: #8F2929;
}

當我對字體和填充字段進行更改時,它會反映在頁面中,但背景圖像字段不會得到反映。 這可能是什么原因?

背景圖像是機器的絕對路徑。 您應該使用基於服務器的相對路徑。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM