18 min read
File Names and Relative Paths
Name files so they work on every server, and link pages and images with relative paths that do not break when the site moves.
Naming Rules
| Web-safe file names | ||
|---|---|---|
Absolute and Relative Paths
Two kinds of path
| Absolute URL | Relative path |
|---|---|
https://www.ceylonleaf.lk/menu.html | menu.html |
| The full address including the domain | Starts from the current file's folder |
| Use for links to other websites | Use for links to pages and images in your own site |
| Breaks if your own domain changes | Keeps working when the folder moves to a new computer or server |
Reading Relative Paths
| Relative path rules | |
|---|---|
Practice
What does ../ mean at the start of a path?
More lessons in Planning a Website · Next: Course Exam · Previous: Setting Up Your Tools
