How to load image in html | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to load image in html

20th Jun 2017, 11:47 AM
Ajay Bisht
8 Answers
+ 7
You should upload your image file anywhere on internet (there are plenty of image hosters, or you could have you own hosting with web hosters), so the url is the adress to your file, as you have adress for web site/pages: http://domain.name/folder/subfolder/image.ext : this is an 'absolute' url as it start with the web protocole (http://), but you can also write relative urls, to get the path relative to the web document inside which you've coded the image tag... However, you cannot use relative url in code playplayground, but you can do use them to access to your local hard disk, if you open a local web document (save your html file in a folder locally, put the image in same folder, and just put the image filename in 'url' attribute ;)
20th Jun 2017, 12:36 PM
visph
visph - avatar
+ 5
Could you be more accurate? If you mean 'display image in an html document (web page)': <img src="url_to_image_file" alt="description">
20th Jun 2017, 11:51 AM
visph
visph - avatar
+ 5
If you use an image hoster, it will be specified when you upload it. If you use web hosters, it will depend of the base address they provide to you, and of the path inside the distant path ^^
20th Jun 2017, 12:51 PM
visph
visph - avatar
+ 5
Thanks: I do when I've time, and while I'm not discouraged ^^ (don't hesitate to upvote posts you think being relevants -- from anybody ;) -- and don't forgot to mark best answer in your threads ;P )
20th Jun 2017, 12:59 PM
visph
visph - avatar
+ 1
@visph, I have been following you for over a week and have found your comments to be quite helpful.You sure know a lot. Keep helping :;)
20th Jun 2017, 12:56 PM
Masquerade
Masquerade - avatar
- 1
Yes that URL, tell me more abt that
20th Jun 2017, 12:27 PM
Ajay Bisht
- 1
From where to get the URL of image?
20th Jun 2017, 12:44 PM
Ajay Bisht
- 1
How to share my html page with some one by a link, I tried to put link in Android but it showed some error
30th Jun 2017, 7:09 AM
Ajay Bisht