Skip to content
← Back to Community
How do you insert a photo in HTML, CSS, JS
Profile icon
NZHacker808

I need to insert a photo in HTML, what do I code to insert a photo?

Answered by Highwayman [earned 5 cycles]
View Answer
Voters
Profile icon
IekatierinaSkr1
Profile icon
riova
Profile icon
NidaUlhasanah2
Profile icon
LucasDameron
Profile icon
AchmadFarel2
Profile icon
AniqNurhaziq
Profile icon
kiranaayaas
Profile icon
RoziahCedric
Profile icon
Braydenvan
Profile icon
LauraVillegas2
Comments
hotnewtop
Profile icon
Highwayman

<img src="LINK">ALTERNATIVE_TEXT</img> where LINK is a url or path to the photo and ALTERNATIVE_TEXT is the text that should be displayed instead if for some reason the img can’t be displayed.

Profile icon
NZHacker808

I'll give you more cycles!

Profile icon
NZHacker808

Because I created it

Profile icon
AisyahDinda

This file cannot be displayed:

Profile icon
NZHacker808

Thanks :D

Profile icon
NZHacker808

You are always here while I'm here :)

Profile icon
Highwayman

@Miner36number2 um hi cool yw? Lol.

Profile icon
NZHacker808
Profile icon
Highwayman

@Miner36number2 you just forgot to put the .png at the end. So it’d be <img src="RIS.png"></img> not <img src="RIS"></img>

Profile icon
NZHacker808

@Highwayman Can you please tell me if you can convert an image which I created into an URL or straight into my HTML? Thank you

Profile icon
Highwayman

@Miner36number2 does storing it in your repl not work?

Profile icon
NZHacker808

@Highwayman What if the picture doesn't have a URL?

Profile icon
Highwayman

@Miner36number2 then you can download it onto your repl
C371E67C-161A-45B7-A92B-C1FC9D61F161
And refer to it using a normal relative or absolute link like with css or js files.

Profile icon
NZHacker808

@Highwayman Thanks, I forgot how to do it :I

Profile icon
Highwayman
Profile icon
NZHacker808

I've never put the photo in a HTML before, so I forgot

Profile icon
NZHacker808

@Highwayman Thanks :D

Profile icon
RababRahman

I only know html:
This file cannot be displayed: .....

Profile icon
NZHacker808

@Highwayman Can you smaller the size of the image?

Profile icon
Highwayman

@Miner36number2 yes, just use the width and height attrs.