Relative vs Absolute Paths
A path is the location of files that pertain to your web page. We often list paths in attributes like
src="". How you write your path, particularly the characters you use to start the path, determine where the browser will look for the files.
Paths take the following forms:
- URL paths — These are paths that use a protocol to retrieve content out on the web, perhaps another server.
- Relative paths — These are paths that start from the current file’s location, and you either work your way up or down the document tree.
- Absolute paths — These are paths that always start from the root folder of a website, regardless of where your file is.
These start with a protocol, like
https:. These will go out onto the web and fetch a web page somewhere based on the URL given. Everything after that is an absolute path.