HTML and CSS Reference
In-Depth Information
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
root folder
Always start
at the root .
“/”
earls_autos
Add on each folder
as you navigate to
the file.
cars
/
cars
new
<html>
.
.
</html>
<html>
.
.
</html>
new
used
/
inventory.html
inventory.html
And then add on
the filename.
inventory.html
Absolute path to
“inventory.html”.
/cars/new/inventory.html
 
 
Search WWH ::




Custom Search