user3309271
user3309271

Reputation: 9

How to give path of images in html

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?

Upvotes: 0

Views: 16923

Answers (2)

Prakash
Prakash

Reputation: 1

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>

Upvotes: 0

Jean-Luc Barat
Jean-Luc Barat

Reputation: 1165

You have two kind of path to access your image :

  1. 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).
  2. Absolute src="/images/s4.jpg".

Upvotes: 0

Related Questions