If you want your images to be seen by people, you need to put them on a hosting server, just like your HTML documents. But if you're using a web hosting service, you will probably need to use an upload form provided by them. These forms are typically in the administration section of your hosting account.
But getting your image to the hosting service is only the first step. Then you need to add it to an IMG tag in the SRC attribute. For example:
Start with Images in the Same Directory as the HTML
1. upload your image, image.gif
, to the root of your website
2. add an IMG
tag to your HTML pointing to that image: <img src="image.gif">
3. upload your HTML file to the root of your website
4. test the file by opening the page in your web browser
But it is more common to store images in a sub-directory, typically called images. In order to point to images in that directory you need to know where it is in relation to the root of your website.
The root of your website is where the URL, without any directories on the end, displays. For example, the root of this site is at http://www.example.com/
. Notice the slash at the end. This is how the root of a directory is usually indicated. Sub-directories include that slash to say where they sit in the directory structure. For example, a site might have the structure:
/ — the root directory
/about/ — the “about” directory
/products/ — the “products” directory
/products/documentation/ — the “documentation” directory under the products directory
/images/ — the “images” directory
Then, when you point to your image in the images directory, you would write: <img src="/images/image.gif">
. This is called the absolute path to your image.