+ 2
how do i put an image file in my html? and use my browser to view it?
3 Respuestas
+ 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.
+ 2
thanks
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.