Smal SEO Tool

HTML File Paths

A file path describes the location of a file in a web site's folder structure.

Absolute File Paths

An absolute file path is the full URL to a file on the internet.

Example: Absolute Path

html
<img src="https://www.w3schools.com/images/picture.jpg" alt="Mountain">
Try it Yourself »

Relative File Paths

A relative file path points to a file relative to the current page. It is best practice to use relative file paths if possible, as they will not be broken if you change your domain.

Example: Relative Paths

Same folder:

html
<img src="picture.jpg">

In a subfolder:

html
<img src="images/picture.jpg">

From the root:

html
<img src="/images/picture.jpg">

One level up:

html
<img src="../picture.jpg">

Test Yourself with an Exercise

What does the `../` notation mean in a relative file path?