Kanbritech Learn logo
HTML HTML Tutorial 45h track

HTML File Paths

From pages/about.html, reference an image in assets/photo.jpg at the project root.

Understand the topic

URLs can be absolute, root-relative, or relative to the current document. An absolute URL includes a scheme and host. A leading slash starts at the current site root. A plain filename starts from the current directory, and ../ moves to a parent directory. URLs are not Windows filesystem paths; use forward slashes and deploy the referenced files.

Worked example

<!-- From /courses/html/index.html -->
<a href="lesson.html">Same directory</a>
<a href="../index.html">Parent directory</a>
<img src="/assets/icons/kanbritech_favicon.png" alt="Academy emblem" width="64" height="64">

The image path starts at the server root. A site deployed under a subdirectory may need a base-path-aware URL rather than assuming the root layout.

Practice

From pages/about.html, reference an image in assets/photo.jpg at the project root.

Show a suggested answer
<img src="../assets/photo.jpg" alt="Describe the photograph">

Common mistake

Do not use C:\Users\... in a public URL. A visitor cannot access your private filesystem path.

HTML documentation

Live Example

Try Coding

Result