I have a bg.gif and when I put it in the css file it's not working. I add it like this:

  background-image: url(bg.gif);
  background-repeat: repeat-x

But the image doesn't appear. Can someone please tell me a way to do it that works?

1 answer

background : #fff url(../images/image.jpg) repeat-x left top;

in your css file will work.

note that the url requires a path relative to the css file.

which means if your css file is in /css/style.css and your images in /images/image.jpg

then the url should be: url(../images/image.jpg) the ../ signifying go up one directory from here then look in the images directory

Answered almost 10 years ago by Tony Crockford