+ 2

I need to display image using HTML but I didn't get .

<!DOCTYPE HTML> <html> <body> <img src="c:\users\My pc\desktop\cactiprick.jpg" alt="cactiprick" width="720" height="720"> </body> </html> Is that wrong with my code?!

30th Jun 2020, 8:19 AM
Pavithra Muniyandi
Pavithra Muniyandi - avatar
7 Antworten
+ 8
you need to change the backslashes in your directory to forward-slashes. also, you didn't close the <img> tag. this should work... Happy Coding <!DOCTYPE HTML> <html> <body> <img src="c:/users/My pc/desktop/cactiprick.jpg" alt="cactiprick" width="720" height="720"/> </body> </html>
30th Jun 2020, 8:40 AM
BRight
BRight - avatar
+ 6
really? can you confirm that your directory is correct? and also check the file extension to confirm its a .jpg file
30th Jun 2020, 8:45 AM
BRight
BRight - avatar
+ 6
okay. do you know where your html file is located?
30th Jun 2020, 8:54 AM
BRight
BRight - avatar
+ 3
Bright Sablah img is an example of empty element so it's not compulsory to close it with slash
13th Jul 2020, 11:20 PM
🙂🙂🙂
+ 2
If you are coding on sololearn you'll have to use url for the source of the image to get the image online.
13th Jul 2020, 11:22 PM
🙂🙂🙂
0
Still, I didn't get the result
30th Jun 2020, 8:44 AM
Pavithra Muniyandi
Pavithra Muniyandi - avatar
0
Yup, I'll confirm that too, what I do ?
30th Jun 2020, 8:47 AM
Pavithra Muniyandi
Pavithra Muniyandi - avatar