css背景网址不能在express中工作 [英] css background url not working in express
本文介绍了css背景网址不能在express中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法为快速部分标签创建背景图片。我尝试了几种不同的路径,包括:
I can't create a background image for a section tag in express. I've tried several different paths, including:
#image{
background: url('/images/beachPierPanorama.jpg') 50% 0 no-repeat fixed;
}
#image{
background: url('./images/beachPierPanorama.jpg') 50% 0 no-repeat fixed;
}
#image{
background: url('../images/beachPierPanorama.jpg') 50% 0 no-repeat fixed;
}
这是我的文件目录的图片。上面看到的CSS位于style.css中,我试图引用图像文件夹中的图像:
This is a picture of my file directory. The css you see above is located in style.css, and I'm trying to reference the image in the images folder:
![IMG]http://i58.tinypic.com/dcbrkx.png[/IMG]
推荐答案
根据图片, / images
目录位于 / public
so
According to the pic, the /images
directory is in /public
so
background: url('../public/images/beachPierPanorama.jpg')....
应该始终有效。
这篇关于css背景网址不能在express中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文