When you are linking to a document on another server or in another area of the Web site, the full (or absolute) URL is used. In the following example, the phrase "Library of Congress Home Page" will be used at the link text -- when someone selects the highlighted phrase, the browser links to and displays the Library of Congress Home Page (absolute URL -- http://www.loc.gov/).
This coding:
Return to the <A HREF="http://www.loc.gov/">Library of Congress Home Page</A>
Renders:
Return to the Library of Congress Home Page
http://www.loc.gov/iug/html/anchor.html
The main home page for this course has the absolute URL:
http://www.loc.gov/iug/html/outline.html
Since both of these pages are on the same server ( http://www.loc.gov/ ) and are in the same subdirectory ( /iug/html/ ), it is possible to reference the page using a relative URL ( outline.html ).
This coding:
Go to the <A HREF="outline.html">HTML Basic Training Class Home Page</A>
Renders:
Go to the HTML Basic Training Class Home Page
Note - when you mouse over this link, the status line displays the full/absolute URL, as resolved by Netscape or Internet Explore, using the address in the BASE tag.
Relative URLs are preferred over absolute URLs when the files you wish to link to are located in the same directory as the current HTML page. This will save time, if you ever relocate your pages.
An internal link and named target allows you to create hypertext links to "targetted" areas of the current Web page. These can be especially useful for navigating to specific locations in a long document, or for providing an easy way to return to the top of the current page.
Creating internal links is a 2-step process:
For instance, the tag to create a named anchor target called "top" would be:
<A NAME="top">text at or near the top of the page</A>
This anchor would not be visible on the displayed page.
In order to link that named anchor/target, a special relative URL is used: instead of a filename, use a pound sign (#) followed by the exact name of the target.
This coding:
Return to the <A HREF="#top">Top of This Page</A>
Renders:
Return to the Top of This Page
Note - when you mouse over this link, the status line displays the full/absolute URL, as resolved by Netscape or Internet Explore, using the address in the BASE tag. Using that full URL, you could link to this internal link on this page from another HTML file on another site.
The URL used in the "HREF" part of the <A> tag can point to any type of files -- even multimendia files like .GIF and .JPG files.
This coding:
Graphic browsers display the image when you select the words <A HREF="http://www.loc.gov/rr/print/guide/pp3869.jpg">Earliest surviving photograph of the US Capitol</A> above. Text browsers like LYNX download the image to your computer account so you can view it later.
Renders:
Graphic browsers display the image when you select the words Earliest surviving photograph of the US Capitol above. Text browsers like LYNX download the image to your computer account so you can view it later.
Go to: