frog1944 frog1944 - 7 months ago 8
HTML Question

Including an image in a list

I'm struggling to get an image in a list. When I do the following:

<ul>
<li><img src="image.jpg"></li>
</ul>


An image icon appears (like an error) and the image doesn't show. Is there anyway to display the image?

Answer

When using <img src="..."/> you can choose two path types.

Local Filesystem

You can select an image to use from the local filesystem. Can be either definite path (C:/Users/...) or relative to the current folder. In your example, you are looking for a file named image.jpg in the current folder which most likely does not exist.

Please note that the file location must be relative to the location of the HTML file.

Remote Image Location

You can insert a link to a remotely hosted image, something like http://your-favorite-image-hosting.com/someimage.jpg.