Image not showing in Firefox but ok in IE

15 03 2011

Last year I spent many hours trouble-shooting a website with an image that was OK in IE, but not visible in Firefox. I looked everywhere in the HTML and CSS to fix the mistake but to no avail.

Anyway, last week when a colleague encountered the same problem and also spent a long time trying to find the solution online, I thought it would be useful to share this very simple fix I discovered on my trouble-shooting journey.

When naming your images DO NOT use a hyphen or an underscore in the name of the file – e.g. image-file.jpg or image_file.jpg. There may also be problems naming files with spacial characters, but I have not tested this extensively so it is up to you to test that theory.