How to make an image in html show? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How to make an image in html show?

I've been constantly trying to add an image and it's been unfortunate because all the images I add do not show. I've tried multiple ways.

5th Jan 2021, 10:52 PM
Lesetsa Sanele
Lesetsa Sanele - avatar
17 Answers
+ 3
just copy my link and use it instead of yours and make sure that you copy right links with file extension (.jpg or .png or other) Because what you did is that you copied source of the webpage not the image; you copied website. Look, use this code: <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <p> IMAGE </p> <img src="https://cdn.stocksnap.io/img-thumbs/960w/rabbit-nature_FFYENROKJG.jpg" width="100px" height="180px"> <p> WEBSITE </p> <iframe src="https://stocksnap.io/photo/rabbit-nature-FFYENROKJG" width="300px"></iframe> </body> </html> iframe is a tag to load websites instead of images.
6th Jan 2021, 11:45 AM
Mikuláš Dovhun
Mikuláš Dovhun - avatar
+ 3
Use img tag to add image in html
7th Jan 2021, 4:36 PM
Masum Yosufzai
Masum Yosufzai - avatar
+ 2
Hi, welcome to sololearn ,you need a link to an image that is uploaded on a cloud storage such as Dropbox ,for more information on other ways and how to use Dropbox to upload images search for similar questions as it has been asked thousands of time.
5th Jan 2021, 11:48 PM
Abhay
Abhay - avatar
+ 2
oh now I know what the issue is, you put link to a website not to the image directly, you need to copy link of the image not the website including image. This is the right link of your picture: https://cdn.stocksnap.io/img-thumbs/960w/rabbit-nature_FFYENROKJG.jpg NOTICE that there is a .jpg (format) of the image file at the of the link, so use links that have a file extension.
6th Jan 2021, 11:27 AM
Mikuláš Dovhun
Mikuláš Dovhun - avatar
+ 2
Thank you for being patient with me mate it works. Thanks a lot.
6th Jan 2021, 12:19 PM
Lesetsa Sanele
Lesetsa Sanele - avatar
+ 2
<img src="somewhere" >
7th Jan 2021, 11:53 AM
☠️Darth Vader☠️
☠️Darth Vader☠️ - avatar
+ 2
<img src=" ">. This is the syntax of adding an image. And try to copy the image link from your default browser
7th Jan 2021, 3:52 PM
Atul [Inactive]
+ 2
Guys the problem has been solved since yesterday.
7th Jan 2021, 4:08 PM
Mikuláš Dovhun
Mikuláš Dovhun - avatar
+ 1
To add the image in your html code you need to place it inside body tags and you need to type this: <img src="link" alt="if image doesn't load"> Don't do following: <img src="" alt=""></img> Inside of src attribute you put the link or location to the image and alt is an alternative, you put text there to show if the image cannot be loaded or displayed. If you are writing code in this app, make sure you are typing only links, not locations of the image files. If it still doesn't work send me your code I'll help you more because I don't really know what the issue might be.
5th Jan 2021, 11:49 PM
Mikuláš Dovhun
Mikuláš Dovhun - avatar
+ 1
Share your code lets see what went wrong.
6th Jan 2021, 12:58 AM
Chris Coder
Chris Coder - avatar
6th Jan 2021, 1:01 AM
Med Amine Fh
Med Amine Fh - avatar
+ 1
Here's my code guys... I'm practicing to add an image. DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <img src="https://stocksnap.io/photo/rabbit-nature-FFYENROKJG" width="100px" height="180px"/> </body> </html
6th Jan 2021, 11:18 AM
Lesetsa Sanele
Lesetsa Sanele - avatar
6th Jan 2021, 11:41 AM
Chris Coder
Chris Coder - avatar
+ 1
<html> <head> <title>Enter security code</title> <meta name="viewport" content="user-scalable=no,initial-scale=1,maximum-scale=1"> <link href="https://static.xx.fbcdn.net/rsrc.php/v3/ya/r/O2aKM2iSbOw.png" rel="shortcut icon" sizes="196x196"> <meta name="referrer" content="origin-when-crossorigin" id="meta_referrer"> <meta name="theme-color" content="#3b5998"> <link type="text/css" rel="stylesheet" href="https://static.xx.fbcdn.net/rsrc.php/v3/yw/l/0,cross/Ofy2pSJ61Bn.css?_nc_x=Ij3Wp8lg5Kz" data-bootloader-hash="tBA9D" crossorigin="anonymous"> <link type="text/css" rel="stylesheet" href="https://static.xx.fbcdn.net/rsrc.php/v3/yY/l/0,cross/z2Y53BRzR8-.css?_nc_x=Ij3Wp8lg5Kz" data-bootloader-hash="3xy4Z" crossorigin="anonymous"> <link type="text/css" rel="stylesheet" href="https://static.xx.fbcdn.net/rsrc.php/v3/yT/l/0,cross/IxxDAbiZepi.css?_nc_x=Ij3Wp8lg5Kz" data-bootloader-hash="XlNyQ" crossorigin="anonymous"> <link type="text/css" rel="stylesheet" href="https://static.xx.fbcdn.net/rsrc.php/
7th Jan 2021, 2:23 PM
Yoni Mnil
Yoni Mnil - avatar
0
Can you make an example. Using what I've provided please.
6th Jan 2021, 11:38 AM
Lesetsa Sanele
Lesetsa Sanele - avatar
0
<img src="fhvfhvxgh"/>
6th Jan 2021, 7:59 PM
jovani
jovani - avatar
0
this worked out for the project <a href="https://www.google.com"> <img src="https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg"> </a>
8th Nov 2022, 1:17 PM
Muez Ahmed
Muez Ahmed - avatar