Images: Subfolders

If not specified, the browser expects to find the image in the same folder as the web page. However, images are usually stored in a subfolder. The subfolder's name must be included in the src attribute:

<img src="/images/html5.gif" alt="HTML5 Icon" style="width:128px;height:128px;">

I'm not exactly sure why, but my images are not found when I use the forward slash in front of the subfolder's name. I don't use the first forward slash at all so my image links look like this:

<img src="images/html5.gif" alt="HTML5 Icon" style="width:128px;height:128px;">

Good habit URLs are case-sensitive! Which is another good reason to always use lowercase for all your HTML documents, image files and the URLs.
Back button Table of Contents Next button