I’m in the process of teaching myself to write basic HTML for a website i want to set up, and i’m having a bit of a problem with an image (a .gif) that i want in my webpage.
Now, i’m aware that the basic coding for inserting an image is:
<img src=“image.gif”>
as long as the .gif image is in the same folder as the HTML file. And when i have the image in the same folder, i have no problem and the image works just fine with this coding.
However, according to the book that i’ve been reading on the subject, it is possible to call up an image from another folder. I would like to do this, because having the images in a separate folder would be easy and convenient.
If i have read the instructions correctly, all i have to do in order to call up an image from a different folder is put that folder’s file extension in the HTML code.
So, for example, my HTML file’s location is:
C:\My Documents\html\american memory\main\main.html
and the image i want to use is at:
C:\My Documents\html\american memory\images\image.gif
My impression was that the appropriate coding to link to the image is:
<img src="/images/image.gif">
because the browser would automatically add the rest of the path. But when i try this, all i get is a red cross, instead of the image. The only way i can get the image to appear is to type the full path, including the C drive, which is obviously no good, because it won’t be the C drive when i upload it to a web server.
Am i doing something wrong here? Is there something i don’t get? Any help would be most appreciated.