How to insert image in HTML | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

How to insert image in HTML

I am not able to insert image in my html page please help me out

8th Jun 2020, 3:14 AM
Hameed Khan
Hameed Khan - avatar
16 Answers
+ 3
Use this tag <img src="source.filetype"> make sure that the picture and the html document are on the same directory. If not use< img src="folder name/source.filetype">
9th Jun 2020, 6:57 AM
Abenezer
Abenezer - avatar
+ 2
you can insert a image by a img tag. for example you have to insert a image which is in new folder: example: <img src="new folder/..." alt="" width="" height=""> (fill these values...) you can set it's width and height by css or by html itself. if its a png file so you have to write .png if its a jpeg file so you have to write .jpeg if its a gif file so you have to write .gif
8th Jun 2020, 3:18 AM
NEZ
NEZ - avatar
+ 1
Thanks NEZ For Answering My Questions. Is it necessary to create a New folder for image or We can directly put our image location
8th Jun 2020, 3:22 AM
Hameed Khan
Hameed Khan - avatar
+ 1
if it's in a folder then write (folder name/image name) if it's not in a folder then you have to only write the image name...
8th Jun 2020, 3:47 AM
NEZ
NEZ - avatar
+ 1
I have done the same way But its not showing on page bro
8th Jun 2020, 3:56 AM
Hameed Khan
Hameed Khan - avatar
+ 1
See this bro <img src="/sdcard/folder/IMG_20200319_123256.jpg "/>
8th Jun 2020, 4:02 AM
Hameed Khan
Hameed Khan - avatar
+ 1
For Html -> <img src="path of an image.jpg" alt="" width="" height=""> NOTE: YOUR IMAGE EXTENSIONS IS .jpg , .png, .jfif or other. I have written jpg for example only. For Css -> I am dam sure that image is not set in your background by writing background-image in css. Instead you have to write following: background:url("path of image.jpg") center no-repeat;
9th Jun 2020, 2:39 AM
NEEL SHAH
NEEL SHAH - avatar
+ 1
<img src="file path>
10th Jun 2020, 11:57 AM
Veeriaperumal
Veeriaperumal - avatar
0
By using img tag
9th Jun 2020, 5:51 AM
Eyosias Mulugeta
Eyosias Mulugeta - avatar
0
Use <img> tag to insert image Best way is to copy image(eg. xyz.gif) in seprate(create new folder where your HTML document is saved) folder eg. Imgfolder now type following code in your HTML document: <img src="imgfolder\xyz.gif"> Where src is the source (URL)of image file(with extension name may be gif,jpg, jpeg,bmp,pnb)
9th Jun 2020, 6:20 AM
seema Jain
seema Jain - avatar
0
<img src="name/location.extension">
9th Jun 2020, 10:17 AM
ALOK GUPTA
ALOK GUPTA - avatar
0
Copy your imageʼs path for example /storage/emulated/0/DCIM/Screenshots/IMG_20200609_145115.jpg
9th Jun 2020, 4:33 PM
Ravshan Baxranov
Ravshan Baxranov - avatar
0
<img src="">
10th Jun 2020, 12:56 AM
Larbi Saib
Larbi Saib - avatar
0
this worked out for the project <img src="https://sololearnassets.azureedge.net/eiffel-tower.jpg" alt="The Eiffel Tower" width="30%" >
8th Nov 2022, 12:44 PM
Muez Ahmed
Muez Ahmed - avatar