Donald Endeavors to Understand Relative and Absolute Links

Manual 
Shutdown Putting an image on a web page ie easy, unless it is located in multiple folders (subdirectories) away. While still a relative link, as in it resides within the same site, with each step the complexity of linking to it grows.

The image installed here resides in the "inserting_images/images" folder. For this page, which is another subdirectory (folder)--to locate the image, the string to locate it is more convoluted than previous strings: " ../inserting_images/images/computer_smash.gif". The two dots/periods that precede the first destination folder to the second and ultimate destination folder--where the image resides, tells the htm document that it must move out of the " folder, up a level/directory, find the "inserting images"folder, then find the "images" folder, and finally find th image "computer_smash.gif". Whew! You have already constructed simple relative links (images and/or files that reside within the same directory/folder), but this doozey is about as complicated as links within the same site will be. The take-away is the process used to create linking paths within the same site but in disparate subdirectories or folders demands accuracy from your code.

Absolute links cite the entire Uniform Resource Locator (URL)/ web address, of the specified destination (e.g.,http://www.spencerian.edu). You could use absolute URL's within your site to locate assets in your site
(e.g., http://www.geocities.com/rlsanden/inserting_images/computer_smash.gif ),
but there is no benefit to this and besides that's a lot more unnecessary coding.

The principle reason to use absolute links is to link to an external web site. With linking to someone else's site comes the use of targeting that absolute so that when it loads it does not load on top of your site in the browser window. This is accomplished by inserting the "target="blank"" within the lt;a href... tag. The &It;a in the &;a href tag simply stands for "anchor."

The last type of relative link can be referred to as either a named anchor or an internal target[you already know the process for creating external targets target="blank")]. The named anchor or internal target type of link is used within the same page for such things as;

To set up an internal target, you select a portion of the page where you would like to viewer to return, for instance the top of the page, and you install the first part of the named anchor:<a name="top">. It doesn�t have to be called "top",it is somewhat like an imagemap with "map name" and "usemap " tags; they just have to match. Additionally, this first half of the internal link is invisible to the viewer; it does not show up in the browser. To complete the second half of the internal target, select a spot where returning to the top of the page would be prudent (say the bottom of the page, or at selected intervals throughout the page) and install <a href="#top">Return to top of page.</a>, or any phrase of your liking within the <a href ...> and &ly;/a> tags to link back to top of the page. The key component is the "#" sign. That lets the browser know that this particular link is within the confines of this page.

As you create your web site, if you have pages that exceed the height of the browser window, forcing the viewer to scroll, you will be expected to insert named anchors allowing the viewer to (at a minimum) return to the top of the page, or any place you deem appropriate. This will be a requirement only in the event your pages scroll. Remember, scrolling is not considered interactivity; scrolling is considered annoying.

Return to top of page.

Hosted by www.Geocities.ws

1