0

why my image is not opened,when i am coding it in notepad

i have changed the name of the pic to skylark.jpg and saved it on desktop. but it is not opening while running the programe

6th Aug 2017, 4:13 PM
neha thakur
neha thakur - avatar
6 Answers
+ 3
<img src="file:///path/to/desktop/picture.jpg"> "file://" instructs the browser to inquire at the local file system (the third slash is to start at the root directory). To retrieve files using "http://" you need to be running a webserver that answers on TCP port 80, then you request images relative to web root: http://images/picture.jpg Where "images/" is a folder inside the folder the webserver considers to be "web root".
6th Aug 2017, 4:24 PM
Kirk Schafer
Kirk Schafer - avatar
+ 2
You can try: Put the jpg in the same place as the web page, then strip the absolute path. A local webserver, like: python -m http.server This image, just to ensure something weird isn't going in [doesn't look like it, doesn't hurt to check]. https://via.placeholder.com/50x50 Do you by chance have file extensions hidden (meaning your file has a double extension)?
7th Aug 2017, 1:36 PM
Kirk Schafer
Kirk Schafer - avatar
0
It's likely an issue with the link. Can I have a look at the code?
6th Aug 2017, 4:24 PM
Saka Oluwadamilola
Saka Oluwadamilola - avatar
0
@saka <!DOCTYPE html> <html> <head></head> <body> <img src="skylark.jpg"/> <header> <h1> <font color="#00AAEE">HOTEL SKYLARK</h1> </header> </body> </html>
7th Aug 2017, 8:28 AM
neha thakur
neha thakur - avatar
0
Following Kirk's guide, point the browser to the image on your desktop like: <img src="file:///C:/Users/neha/Desktop/skylark.jpg"/>
7th Aug 2017, 9:21 AM
Saka Oluwadamilola
Saka Oluwadamilola - avatar
0
i have done all that.. i have copied image address and pasted that on code.. dont work. when i inspect element, for image its showing failed to load resource:net::err_file_not_found
7th Aug 2017, 9:30 AM
neha thakur
neha thakur - avatar