image path correct, for localhost

I'm using a web development program (Aptana) that when I run the html page, it runs it here:

http://127.0.0.1:8000/RadiantOrigins/index.html

Now, I have in my index.html file, style/css at the top in the head element:

body {
    /* background-color: red; */
    background-image: url('../EverythingImportant.jpg');
}

Ok, thanks, I can put the image under the same directory as the index.html file, and it finds it.

But if I put EverythingImportant.jpg under the images directory, a subdirectory where the project is, none of these work:

background-image: url('images/EverythingImportant.jpg');
background-image: url('/images/EverythingImportant.jpg');
background-image: url('./images/EverythingImportant.jpg');
background-image: url('../images/EverythingImportant.jpg');

Hmm, double checking. Yup, none worked.


试试看......

background-image: url('../EverythingImportant.jpg');

Aptana doesn't see the image until you refresh it's file contents inside the tool. So even though you have the image there, it doesn't recognize it.

链接地址: http://www.djcxy.com/p/30542.html

上一篇: 这是这种风格的源代码标签

下一篇: 图像路径正确,为本地主机