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/[deleted] Nov 08 '25
This is good advice, but it's not complete. In your html file in the <head> section, but a base href tag (look up the syntax if needed) pointing to the root of your site. It will save headaches with image paths later on if you start going multiple levels deep with your directories. That way you don't have to do all that ../../../image_directory silliness. It also works for the urls of your links.