Skip to content
Justice Tech School

File Paths

A path tells the browser where a file is. "photo.jpg" means the same folder, "images/photo.jpg" means a sub-folder, "../photo.jpg" means one folder up, and "/images/photo.jpg" starts from the site root.

A full URL (https://...) points to a file on another site. Relative paths are better for your own files because the site keeps working if you move it.

Example
<img src="photo.jpg" alt="Same folder">
<img src="images/photo.jpg" alt="Sub-folder">
<img src="../photo.jpg" alt="Parent folder">
<img src="/images/photo.jpg" alt="From the site root">

Exercise

Go up one folder.

<a href="/index.html">Back</a>

Quiz Test

What does ../ mean in a path?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.