A file path describes where a file (image, stylesheet, script, page) is located.
picture.jpg: in the same folder as the current page.
images/picture.jpg: in the images folder inside the current folder.
/images/picture.jpg: in the images folder at the root of the site.
../picture.jpg: one folder up from the current folder.
https://example.com/picture.jpg: an absolute URL on another site.
Use relative paths for your own files. Your site will keep working when you move it to a new domain.
💡 Key Takeaways: HTML File Paths
Mastering HTML File Paths helps you write clean and reliable HTML code. Follow standard conventions, test edge cases, and keep logic simple. Try running the code example below and complete the exercises to build confidence.