CSS Background image not loading

First of all, wave bye-bye to those quotes:

background-image: url(nickcage.jpg); // No quotes around the file name

Next, if your html, css and image are all in the same directory then removing the quotes should fix it. If, however, your css or image are in subdirectories of where your html lives, you'll want to make sure you correctly path to the image:

background-image: url(../images/nickcage.jpg); // css and image live in subdorectories

background-image: url(images/nickcage.jpg); // css lives with html but images is a subdirectory

Hope it helps.


I had the same issue. The problem ended up being the path to the image file. Make sure the image path is relative to the location of the CSS file instead of the HTML.


here is another image url result..working fine...i'm just put only a image path..please check it..

Fiddel:http://jsfiddle.net/287Kw/

body 
{
background-image: url('http://www.birds.com/wp-content/uploads/home/bird4.jpg');
padding-left: 11em;
padding-right: 20em;
font-family:
Georgia, "Times New Roman",
Times, serif; 
color: red;


}

try this

background-image: url("/yourimagefolder/yourimage.jpg"); 

I had the same problem when I used background-image: url("yourimagefolder/yourimage.jpg");

Notice the slash that made the difference. The level of the folder was the reason why I could not load the image. I guess you also encountered the same issue


I ran into the same problem. If you have your images within folders then try this

background-image: url(/resources/img/hero.jpg);

Don't forget to put the backslash in front of the first folder.