meee meeee
meee meeee

Reputation: 211

how do I fix the HTML img tag to display an image

I'm trying to display to the enduser an image, but this tag wouldn't work, how can I fix it please ?

<img src="file:///E:/images/avatars/21082013184506Id.png" height=70 width=70 />

Thanks in advance.

Upvotes: 0

Views: 117

Answers (4)

Alexander
Alexander

Reputation: 122

as John asked in the comment, the image will only appear when the source path specified is available to user viewing the html.

The attribute src="file:///E:/images/avatars/21082013184506Id.png" means the user must have access to E: drive.

If you want this to work online on the internet, upload the image with your page and specify path to it e.g. in case it is in same folder as you html

src="21082013184506Id.png"

if it is in images/avatars subfolders

src="images/avatars/21082013184506Id.png"

I would also recommend quoting the width/height attributes i.e. width="70" height="70", or even better set those values via CSS, but that a different topic :)

Upvotes: 0

q0re
q0re

Reputation: 1359

The image in src="" is on your own hard disk.

Upload the image to a image-uploader like imageshack or a webserver.

Put in src="" the correct path to the file.

Upvotes: 0

Behzad Hassani
Behzad Hassani

Reputation: 2139

your file addressing is absolute, It works just on the machine which that image exists on that directory, you should use implicit addressing.

Upvotes: 1

Quentin
Quentin

Reputation: 944490

  • End users will not have access to your hard disk.
  • Some browsers block access to images on file:// URIs from pages loaded over HTTP.

Use an HTTP URI for your src.

Upvotes: 0

Related Questions