3

I am trying to refer to an image file which is outside source folder. The current structure is

Images/img1.png

My Source Folder / Page-1 / index.html

From the index.html file, I want to refer to img1.png file.

I tried the following codes

<img src="../Images/img1.png">
<img src="../../Images/img1.png">

I don't want to hardcode the location because we have to deploy the code in production server and we are restricted to access the server and the details of the server. We only know that the server is Windows based server.

Can any one please help me? Thank you.

user1787687
  • 316
  • 3
  • 4
  • 11
  • second one should work, is your `Images` folder accessible by your server ? – Majid Laissi May 10 '13 at 14:31
  • Possible duplicate of [HTML - pick images of Root Folder from Sub-Folder](http://stackoverflow.com/questions/3655059/html-pick-images-of-root-folder-from-sub-folder) – Liam Nov 21 '16 at 16:33

1 Answers1

6

You have to move three folders:

<img src="../../../Images/img1.png">

Hope this helps!

cortex
  • 5,036
  • 3
  • 31
  • 41
  • If `Images` and `My Source Folder` are the same level, only two `..` are sufficient – Majid Laissi May 10 '13 at 14:35
  • 2
    Two `..` is `My Source Folder` but `Images` is not inside it, it's a sibling folder, so you need to move one more... to the "root". – cortex May 10 '13 at 14:55