Create Relative Hyperlinks
by
Agatha Taormina
|
A hyperlink is a direct connection from the current location of the cursor to another location. An absolute hyperlink is a connection that goes out onto the World Wide Web to find the site being linked to. |
||
|
You can, if you wish, make all of your hyperlinks absolute hyperlinks. However, if you are linking from one page in your own web site to another page in the same web site, it is generally quicker and more efficient to jump between site pages or site folders rather than go all the way out to the Web, only to return to your own site. A link to another page (i.e., file) in your own site is called a relative hyperlink. The format is the same as the format for an absolute link: <A HREF="[address]">[Clickable text]</A> However, for the address you need only use the directory path (if the file is in a different folder) and the filename of the file you want to link to. |
||
| Example | For example, all of the files in my Web
Design Center site are in a folder called wdc.
This folder is inside my homepage folder which is called ataormina
which is in a folder called home on Novaweb, the web server of
Northern Virginia Community College where I am on the faculty.
Thus this page, the page you are reading now, is actually a file called rellinks.htm. This file is in the folder called readings which is in the folder called wdc which is in the folder called ataormina. So if I want you to read another one of the files in the readings folder, in this case an article I wrote about structuring a web site, I will refer you to another file in the readings folder, Create a Web Site Structure The code to create the above link looks like this: . . . refer you to another file in the readings folder, <A HREF="webstructure.htm">Create a Web Site Structure</A>. |
|
| However, all of the tutorial files in my Web Design Center are organized in folders named after the software programs being described in the pages. | ||
| So if I want you to take a look at the specific
information on using Dreamweaver to Create
Relative Links, I have to set you on the correct directory path
The code to create the above link is: . . . using Dreamweaver to <A HREF="../dreamweaver/links3.htm">Create Relative Links</A> |
NOTE: The symbol ../ indicates the level above the current level of the directory tree. | |
|
When you create a web site you should always make it your practice to use relative hyperlinks for all of the pages within your web site. If you use relative links and then want to move the web site from its original server to another server, the only links you will have to change throughout your site are the links to your home page. |
Web
Design Center Readings
Last Revised:
February 6, 2003
© Agatha Taormina