+ 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?!
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>
+ 6
really? can you confirm that your directory is correct?
and also check the file extension to confirm its a .jpg file
+ 6
okay. do you know where your html file is located?
+ 3
Bright Sablah img is an example of empty element so it's not compulsory to close it with slash
+ 2
If you are coding on sololearn you'll have to use url for the source of the image to get the image online.
0
Still, I didn't get the result
0
Yup, I'll confirm that too, what I do ?