When I transfer my html files from my pc to phone the images is not seen in my phone due to source path .how can I get images?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

When I transfer my html files from my pc to phone the images is not seen in my phone due to source path .how can I get images??

9th Jan 2019, 1:55 PM
Radhika Sharma
4 Answers
+ 5
You can get the images by placing the images in the same folder in which your html file is stored in your phone. Important - The 'src' attribute of 'img' tag should contain only the name of image instead of previous source location of your PC. Example- <img src="image_name.jpg">
10th Jan 2019, 1:39 PM
MOHIT SHARMA
MOHIT SHARMA - avatar
+ 4
you can upload them to imgur(or something else online) and use the path to get to the website.
9th Jan 2019, 8:37 PM
Korijn Jagersma
Korijn Jagersma - avatar
+ 4
Alternatively use a relative path, don't save the images in a separate folder than your html files, when referring to the images don't use this C:\user\document\image\pics1.png Rather use something relative refer directly to the image project ImageFolder\pics1.png. Again be sure to make the folder present in the site directory. It should work.
10th Jan 2019, 7:37 AM
africana
africana - avatar
+ 2
if your HTML is in an seperate folder like website.com/animals/index.html you can use /.. and go back a folder like website.com/animals/index.html/../css/main.css, that’s basicly the same as website.com/css/main.css
10th Jan 2019, 2:47 PM
Korijn Jagersma
Korijn Jagersma - avatar