0
我使用express + node.js + Jade。我写了一个玉文件,但我不能让背景图像出现。我打得四处体类,它似乎文本颜色的工作,但在玉石中使用背景图像
body {
font-family: "Josefin Slab" !important;
background-image: url("concursum-bg.jpg");
background-size: cover;
color: white;
text-align: center;
background-repeat: no-repeat;
}
我确信该图像是在同一文件夹,因为这玉文件时,它不使用背景图片。
当我查看网页源代码的HTML是:
body {
font-family: "Josefin Slab" !important;
background-image: url("concursum-bg.jpg");
background-size: cover;
color: white;
text-align: center;
background-repeat: no-repeat;
}
我在本地主机上运行此,如果该事项。
会在哪里我创建了 “公共” 目录?在视图所在的目录中? – SocketPhys
它的工作原理,但我想知道为什么快递无法在视图目录中提供服务? – SocketPhys
@SocketPhys Express默认情况下不会这样做,而且它确实没有任何理由。 – Aehmlo