+ 2

how do i put an image file in my html? and use my browser to view it?

7th Sep 2016, 10:16 PM
Terry Jephtah Shemishere
Terry Jephtah Shemishere - avatar
3 Réponses
+ 3
html: <img src="path/to/your/image"></img> If your image is in the same folder as your html file, just put the name of your image in the src field. If you are using Code Playground, host your image first (look up for free image hosting on the web), and then put the image url in the src field. If you don't want to bother with that and just want to try out <img>, just put the url of a random image. Example: This html bit will show your avatar. <img src="https://api.sololearn.com/Uploads/Avatars/1912847.jpg"></img> To view your html page, open it with your browser.
7th Sep 2016, 10:26 PM
Zen
Zen - avatar
+ 2
thanks
7th Sep 2016, 10:38 PM
Terry Jephtah Shemishere
Terry Jephtah Shemishere - avatar
0
Use <img src=" " /> Here, scr will be the file/image name. Make sure that you save your image where you have saved your .html file or it won't display on your browser. You can add Alt="your_message" withing img tag Alt means alternate If image won't be displayed on your browser this message will be displayed.
9th Sep 2016, 5:53 PM
Rishit Sonecha
Rishit Sonecha - avatar