Absolute Links

An absolute link includes a full description of a URL in the link information. Going back to the example on the previous page, if you want to create a link from the default.htm file in the assignment06 folder, to the default.htm file in the assignment07 folder, the HTML would look like the following:

<a href="http://homepages.findlay.edu/trusty/565/assignment07/default.htm">Click Here for Assignment 7</a>

The HTML information gives all the information required to get to the destination, from anywhere on the Internet. First, the HTML says go to http://. This tells your browser that the destination is a web page. Next the browser is instructed to go to homepages.findlay.edu, which is the address of the web server that houses the destination web page. Once at that server, the HTML points the browser to the destination folder, /trusty/565/assignment07. Finally, the browser is told to open the default.htm file.

Because absolute links contain more information, they take longer to type. That means more work when creating the HTML. The good side is that once created, the same HTML code can be placed on any page, on any server on the Internet, and it will still work correctly.

There is one downside to absolute links. If you are working on a test server, where the domain name (that's homepages.findlay.edu in our case) is different, you can't test your links using only the test server. There is a "happy medium" that you can use. You can create an pseudo-absolute link that is absolute for the current server. Here is how it would work.

I have a test server called http://trusty-xp at my house. In fact, I'm creating this web page on this test server right now. I have a folder on my test server named /trusty/565/assignment07 and in that folder I have a file called default.htm. For convenience sake, I have created a folder structure on my test server that is identical to the homepages.findlay.edu production server. If I create absolute links on my test server, they will direct me out to the producation server (homepages.findlay.edu) every time I click on a link. So I create pseudo-absolute links. This is an absolute link that works only on the "current" server, whether the correct server is my test server or the production server. I create a link that looks like this:

<a href="/trusty/565/assignment07/default.htm">Click Here for Assignment 7</a>

I have removed the http:// and the domain name from the HTML. I start the hypertext link information with a "/" (slash). This tells the browser to go to the top folder on the "current" server. From there, the browser follows the folder paths that are listed, ending with the default.htm file.

There are two benefits to creating a link in this manner. I can test the link on my test server, and when I move the files to the "production" server, the links will work on that server. On any given server, these are absolute links specific to the local server. I can put the link in any folder on the server, and the links will still work. No matter how deep I go into the folder structure, the HTML link always starts by going to the top (slash) folder, and working down from there. So I don't have to worry about the relative location of folders to each other when I make a link.

Image Maps

Assignment 7 Home Relative/Absolute Image Maps Mouse Overs