Absolute and Relative Addresses
The full address of a Web page, using the protocol, domain and file name, is called the "absolute" address.
Below is an illustration of a folder on a Web server that has the domain name "www.webserver".
The index Web page can be addressed with its absolute address of "http://www.webserver/webpages/index.html".
HTML code in the "index.html" file can also address any files wi tnm the "webpages" folder just using their file name.
This js called the relative address.
In the illustration, code in "index.html" file can refer to the "next.html" file simply as "next.html", or with the absolute address of "http://www.webserver/webpages/next.html".
A relative address can also refer to a file within the upper level folder that contains the current folder by preceding its file name with the syntax " ../ ".
In the illustration, any document in the "extra" folder could address the "next.html" document in the "webpages" folder as "../next.html".
Alternatively the absolute address can also be used to address the "next.html" document from within any other document as "http://www.webserver/webpages/next.html".
Back to HTML Tutorials |