NealR
NealR

Reputation: 10709

Background Image not loading on server

Just moved my project from my machine to our DEV server and I cannot get the background image to load. I've navigated to the url of the image (http://domain.sitename.com/Images/imagename.jpg) and there the image loads fine. I've also checked the security on the folder and can see both the IIS user group and the service account we're using for the site. Since I'm a complete n00b when it comes to CSS, I'm pretty sure the error is somewhere in there but I haven't been able to find a configuration that works. At this point would appreciate any leads/directions/hints/tips for figuring this out.

CSS

*{
    margin:0px;
    padding:0px;
}
html {      
    margin: 0;
    padding: 0;
}
body{
    background-image: url('Images/Swiftnet-Background.jpg');
    color:#444444;
    font-size:13px;
    font-family:"Century Gothic", Helvetica, sans-serif;

}

Here's a screen shot of our folder structure

enter image description here

Upvotes: 0

Views: 1978

Answers (2)

user3806642
user3806642

Reputation:

What Lochemage has said seems to be the only problem that I could find! Ensure you upload your image in a folder named "Images" in your cPanel File Manager. The index.html can simply be uploaded on the first page.

Then create a folder named "Images" and upload your image with the same name, Siftnet-Background.jpg, into the folder.

Upvotes: 0

Lochemage
Lochemage

Reputation: 3974

Any url you reference, unless it is a full http url, will be relative to where the css file resides. If your css is in root/Content, then your image folder must be in root/Content/Images. If Images is actually back one folder, then you need to change your css url's to be url("../Images/imagename.jpg") instead.

Notice the two dots before "/Images" in the url, two dots means go back one folder. If you need to go back two folders, then use "../../Images" etc.

Upvotes: 1

Related Questions