HTML and CSS Reference
What's an absolute path?
The last time we talked about paths, we were writing HTML to make links with
the <a> element. The path we're going to look at now is the absolute path part
of a URL, the last part that comes after the protocol (http) and the website name
( www.starbuzzcoffee.com ).
An absolute path tells the server how to get from your root folder to a particular
page or file. Take Earl's Autos site, for example. Say you want to look in Earl's
inventory to see if your new Mini Cooper has come in. To do that, you'll need
to figure out the absolute path to the file “inventory.html” that is in the “new”
folder. All you have to do is trace through the folders, starting at the root, to get
to the “new” folder where his “inventory.html” file is located. The path is made
up of all the folders you go through to get there.
So, that looks like root (we represent root with a “/”), “cars”, “new”, and finally,
the file itself, “inventory.html”. Here's how you put that all together:
Earl 's Autos
at the root .
Add on each folder
as you navigate to
And then add on
Absolute path to