+ 2
I tried saving the image file in same folder as the html file, but it's not working..... The syntax is, <img src=" url"/> right?
Correct me if wrong... I'm stuck on this part since last 5 days, also I'm not coding on this app but on notepad by Windows. What is the easiest way to add image to html?
11 ответов
+ 10
Is it anuhtml or anu.html? You should add .html extention properly..
And as already said, it only works for you may be in PC only the link, but any for any other here, it is invalid link..
To work here for all,. Check these :
https://www.sololearn.com/learn/HTML/1030/
For your device to playground, You need to upload file to a cloud site like Dropbox, if your file is in your mobile... So upload and then copy that link and paste as src value.
To know how to upload and import to Program.
Run this code and see steps to follow:
For images :
https://code.sololearn.com/Wy3lrXNwGsgJ/?ref=app
For all files :
https://code.sololearn.com/WW6t4B73kJVz/?ref=app
https://www.sololearn.com/discuss/2402873/?ref=app
+ 5
You wrote right code, it should be work check it again
+ 3
Or share your html code with us
+ 3
<img src="C:\Documents and Settings\samsung\Desktop\anu html">
Here this was my main image code.... Ofc I mentioned html tags also the body tags
+ 2
I had not tried in pc but
Try this once
src="file:///C:\.......anuhtml"
If it works
+ 2
Note:-
If you link images from local storage it will be accessible/visible on only that device.
So better if you use a hosted images from any drive/website
For free images you can check method in code output
https://code.sololearn.com/WZZou4tJQrjO/?ref=app
+ 2
https://code.sololearn.com/WVZIiep1rjJB/?ref=app
Divya I tried using your method but again in vain..... Plz check it and let me know where am I going wrong.
+ 2
It's actual link is this
https://images.pexels.com/photos/2023384/pexels-photo-2023384.jpeg?auto=compress&cs=tinysrgb&h=750&w=1260
I have mention to "open image in new tab"
But I think you have just click on it or choose open in new tab
that why your link is url of page not an image.
+ 2
It is better insert an image to insert image from web so that everyone can access it if you insert from your pc then it will not be visible to other. You can insert image by the following code
<img src="image.jpg" alt="alternative if the image is not displayed somehow"></img>
Your can copy the image link as it is from web but open the image in a new tab
Hope it Helps
👍👍☺️☺️
+ 2
Thank you soo much everyone... It did work👍👍
And Divya thankyou once again for suggesting those websites.
Thanks everyone 😇😊👍👍😀
+ 2
Isn't like this <img src="example.jpg" alt="example image" />