Suppose I have a folder named Imp and in it,I have a webpage folder and a images folder.I have my webpage in webpage folder and my images in images folder. So, how can I give the path of an image s4.jpg present in images folder from a webpage in webpages folder..i mean what should I write in the src attribute of img tag?
Asked
Active
Viewed 1.6k times
1
-
`src='../imagesFolder/s4.jpg'` – manta Feb 22 '14 at 11:07
-
without seeing your directory structure, i'm not surprised. – manta Feb 22 '14 at 11:11
-
1src="//yourDomain.ex/Imp/images/s4.jpg" (This is an absolute path) – Kostas Feb 22 '14 at 11:12
-
possible duplicate of [Basic HTML - how to set relative path to current folder?](http://stackoverflow.com/questions/296873/basic-html-how-to-set-relative-path-to-current-folder) – Ragen Dazs Feb 22 '14 at 11:27
2 Answers
0
You have two kind of path to access your image :
- Relative
src="../images/s4.jpg"
(up to parent is relative from where your page is display, here the page is run from direct sub directory). - Absolute
src="/images/s4.jpg"
.

Jean-Luc Barat
- 1,147
- 10
- 18
0
If In documents folder of c drive you have made a folder imp and in the imp, you have made another folder named - "images"
then your code should be -
<img src="../imp/images/filename.ext>

Bhargav Rao
- 50,140
- 28
- 121
- 140

Prakash
- 1