-1

I've just uploaded a website from my computer to a remote server.

everything was working on my local machine, and works on the remote server - aside from 1 background image!

all images are in the same directory, with same permissions. just the 'Main-Header-graphic.jpg' doesn't work. I have this in my CSS:

/* this works */
#top_header #logo {
float: left;
background: url(../img/Logo.png) no-repeat;
width: 403px;
height: 52px;
text-indent: -9999px;
}

/* this doesn't! 
   if i replace the "../img/Main-Header-graphic.jpg" below with another image, eg.
   the "../img/Logo.png" above, it works! */
#middle_header {
margin-top: 10px;
height: 280px;
background: url(../img/Main-Header-graphic.jpg) no-repeat;
}

so as you see the paths to images are all the same, and work in the same format with all the other background images. Just the middle_header background doesn't work! any ideas?

thanks, Patrick

Patrick
  • 1,265
  • 7
  • 21
  • 33

4 Answers4

1

I had this exact same problem. Just a couple of images that when displayed locally, worked fine. From the server, no go. Found out it was a discrepancy in my camel case.

Example:

CSS code: ../images/myImage.png

Actual image address: ../images/myimage.png

I changed it to match and viola! Kind of disconcerting.

1

Only thing I can think of is that it might be something wrong with the image itself. Try opening the image in Photoshop, and if you can, save it to another format - or as a .jpg with some different compression settings. Then re-upload and see if it works.

o01
  • 5,191
  • 10
  • 44
  • 85
  • tried that, but with no luck. I don't know why, but the problem seems to be in the name of the image, for whatever reason. I've renamed it using underscores instead of dashes, and it seems to be working now... – Patrick Nov 28 '10 at 14:18
1

I had this same problem recently, and it was because my image file was "examplepic.JPG", but in CSS I had it as "examplepic.jpg". As soon as I changed the CSS code to show the bg image's file extension in all-caps, it worked...

-1

Try to wrap the url with quotes:

url("../img/Main-Header-graphic.jpg")
Genius
  • 1,784
  • 14
  • 12