Relative paths
Relative paths describe a file location in relation to the current HTML document.
Learn how websites are structured from the ground up using HTML. Build real pages while learning elements, attributes, links, images, forms, tables, semantic HTML and more.
Lesson 19 of 24
12 min learning time
Relative paths describe a file location in relation to the current HTML document.
Organizing images, CSS, JavaScript and pages into folders makes projects easier to maintain.
<img src="images/logo.png" alt="Logo">
<link rel="stylesheet" href="css/style.css">
<a href="pages/about.html">
About
</a>
Practical Exercise
Create a simple project folder containing pages, images and css directories.
Quick Check
Which path refers to an image inside an images folder?