# Solved: Safari and the html <IMG> tag



## andynic (May 25, 2007)

Hi,
I'm a complete newbie at this. Have written some HTML that puts up a table and within the table an image. The code works perfectly in Internet Explorer v7. Then I downloaded Apple's Safari for Windows XP and tried it there. The image does not appear. I have also followed the instructions under Safari's help -- that is, gone to Edit --> Preferences --> Appearance and checked the "Display images when page opens" -- to no avail.

Here is the code that works in IE7. Can anyone help?







[TD]<a href="http://andynic.zenfolio.com/p846497533/slideshow#h14fd72ea">Barcelona



Pic name
blah blah blah
blah blah blah

[/TD]

Thanks very much,
Andy Nicastro


----------



## JimmySeal (Sep 25, 2007)

The most likely cause is that the src= attribute in the IMG tag has the path of a file on your local hard disk and Safari doesn't understand it. Are you planning to only make this page available on your computer or do you plan to put it on the web?


----------



## andynic (May 25, 2007)

Hi Jimmy,

Thanks very much for your quick reply.

Initially I am planning to develop this file on my computer and would like to test it completely there. Then I want to hand it over to my son so he can have a look at it on his. If he likes it, then we may then put it on the web.

Is there perhaps some work-around for this.

Thanks again,
Andy
PS There is also a problem with the background. I assume it is a related problem?


----------



## andynic (May 25, 2007)

Hi Jimmy,

After I posted my last reply to you, something you had said, made me try taking out the pathName and put the files in the same directory as the html file. This has solved the problem.

Thanks,
Andy


----------



## tomdkat (May 6, 2006)

JimmySeal said:


> The most likely cause is that the src= attribute in the IMG tag has the path of a file on your local hard disk and Safari doesn't understand it.


The format of the location of the file in the "src" attribute is incorrect.

A "file:///" needs to be added to the beginning of the URL, like this:

file:///C:\Documents\Documents_20090101_to_20091231\Computing\P7060016.jpg

Try that and see what that does. Ideally, you should be using "relative paths" to reference images, to keep things simpler for you (in the long run). This means, the location of the image must be "relative" to where the HTML file is located.

So, do this: put the HTML file in a folder, like on called "website". This folder can be anywhere. Then, inside the "website" folder, put _another_ folder called "images". Then, put ALL the images for your site inside the "images" folder. Then, in the HTML file change the location of the image you want on the page to "images/{image name}".

So your above table would change to this:

[TD]<a href="http://andynic.zenfolio.com/p846497533/slideshow#h14fd72ea">









[/TD]

Good luck!

Peace...


----------



## andynic (May 25, 2007)

Hi Tomdkat,
Thanks very much for your detailed reply with example. It is very helpful, and works perfectly. Appreicate your taking the time to write it even though I had marked the thread solved.
Andy


----------



## tomdkat (May 6, 2006)

Yeah, I was busy typing away when you posted your update so I missed by *that* much. 

Peace...


----------

