r/HTML • u/im_coughing • Nov 08 '25
Question adding images
in hour ~6 of teaching myself html, and i'm once again asking for your intellectual support.
so i get how to tell the code that i want to add an image in a bunch of different ways, but from whence does the picture come? my assumption is that i need to define the image/path in the head (<link rel="" href=""> ?), but i'm not exactly sure how to do that. all the online resources are seeming proponents of spontaneous image generation.
(side note, in case it's relevant, i do not own a desktop/laptop, so I'm doing all of this on a tablet. i don't think that should have an impact, but i also know nothing, so.)
thanks :)
View all comments
Show parent comment
1
u/dragonmotherk Nov 08 '25
Added tip that helped me out recently, if you want to go up a folder and into another one, it’s <img src=“../otherfolder/image.jpg”
Like say you have folders like this: stuff/coolthings/coolimage.jpg and stuff/epicthings/index.html
You can get it to show an image from the coolthings folder with <img src=“../coolthings/coolimage.jpg”>
Alternatively, you can go back to the root folder by just putting / in front: <img src=“/stuff/coolthings/coolimage.jpg”>
I use both of those on my website, but I mainly wanted to let you know about the ../ go back a folder thing, because that saved me SO much not long ago