user2847948
user2847948

Reputation: 149

Relative path on a Mac

It may be me, or it might be my Mac Book Pro, 10.8.5, Safari 6.0.5. I cannot use a relative path in my HTML. I have folder A. Within folder A I have an images folder; my index.html code is also in folder A. Yet I code:

<img src="images/photo.jpg" alt="Something" />

and I get the blue square with the white question mark; image not found. If I'm on a Windows machine, I have no problem with a relative path. If anyone has any ideas, please let me know.

Upvotes: 2

Views: 20689

Answers (1)

original_username
original_username

Reputation: 2399

enter image description hereRelative paths should work just fine. I just tested your example, and the image loaded without issue.

Why does it work on my Mac, and not yours?

Things to try:

  1. Check your file and folder names carefully for typos
  2. Make sure file extensions are not hidden ( Finder > Preferences > Advanced > Show all filename extensions )? Maybe your jpeg is actually 'photo.jpg.jpg'
  3. Reload the page in Safari ( Shift + Click on the refresh button )
  4. Test with an alternate jpeg image to rule out issues with the file system.

Upvotes: 2

Related Questions