0

Having issues with adding images in html. tried using a browser to open the html file but it didn't display the image

26th May 2019, 11:00 PM
Josh Martin
Josh Martin - avatar
10 ответов
+ 1
Please post some code or more specific question. Remember that you should use <img src="url/of/your/image.png" />
26th May 2019, 11:04 PM
Andres0b0100
Andres0b0100 - avatar
+ 1
the image is local(in my file)..
26th May 2019, 11:12 PM
Josh Martin
Josh Martin - avatar
+ 1
If you have the html file and the image in the same directory, you just have to write the image filename and extension in the src attribute, example <img src="puppy.jpg" />
26th May 2019, 11:16 PM
Andres0b0100
Andres0b0100 - avatar
+ 1
Mmm, are you sure there aren't other problems in your code? Also are you sure you're typing the filename well?
26th May 2019, 11:24 PM
Andres0b0100
Andres0b0100 - avatar
26th May 2019, 11:32 PM
Josh Martin
Josh Martin - avatar
+ 1
thats what d code looks like.to me every thing seems ok
26th May 2019, 11:33 PM
Josh Martin
Josh Martin - avatar
+ 1
Are you typing the filename correctly? You have to write the file extension (.png / .jpg / .gif)
26th May 2019, 11:41 PM
Andres0b0100
Andres0b0100 - avatar
+ 1
Thank you.. all my fault.. spelt it wrongly..thanks a million
26th May 2019, 11:46 PM
Josh Martin
Josh Martin - avatar
+ 1
No problem, it's a common mistake even for professional programmers :p
26th May 2019, 11:48 PM
Andres0b0100
Andres0b0100 - avatar
0
tried it...i put the html file and the image in the same folder. then <img src="project1".jpg" alt=""/>. but chrome didnt view the img
26th May 2019, 11:21 PM
Josh Martin
Josh Martin - avatar