背景图像不在线显示,但在本地

时间:2011-08-27 17:01:15

标签: css path background

有人可以在这里指导我吗?

CSS

background: url(/img/background_sw_web.jpg) no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover; 

路径

http://piscolabis.info/img/

图片:

http://piscolabis.info/licht/img/background_sw_web.jpg

我不能使用绝对路径,因为该域用于测试

测试:http://piscolabis.info/licht/

必须有趣的是,在FF中使用editCSS插件,当我点击“编辑css”并且侧边栏加载CSS时,图像显示,

2 个答案:

答案 0 :(得分:1)

路径不应该像/licht/img/background_sw_web.jpg那样吗? 或者,如果引用该图像的文件位于同一文件夹(例如licht文件夹)中,只需删除路径开头的正斜杠即可。所以它就像img/background_sw_web.jpg

答案 1 :(得分:0)

纠正你的道路:像这样:

background: url(../img/background_sw_web.jpg) no-repeat center center fixed;

添加.. /img,例如../img

相关问题