Back to Unit 6

Unit 6 Website Development - Tutorial 1

1.9 Insert images using correct file paths

Continue the School Coding Club website by adding an image from the images folder.

How Images Work

Images are added with the <img> element. The src attribute tells the browser where the image file is stored.

If the file path is wrong, the browser cannot find the image and it will not display correctly.

Image Example

<img src="images/coding-club.jpg" alt="Students learning to code at a computer">

This looks for a file called coding-club.jpg inside an images folder.

Path Examples

Folder structure Correct image path
Image is in the same folder as the HTML file. src="coding-club.jpg"
Image is inside an images folder. src="images/coding-club.jpg"
Image is inside images/products. src="images/products/item.jpg"

Build It Yourself

  1. Open the same unit-6-website folder.
  2. Place a suitable club-related image inside the images folder.
  3. Rename the image to a clear file name, such as coding-club.jpg.
  4. Add an <img> element to index.html.
  5. Set the src to the correct file path.
  6. Open the homepage and check that the image appears.

Common Mistakes

Success Checklist