HREF stands for Hypertext REFerence. An HREF anchor can be used to create a link to another document on the web, or to create a link to a specific location within a document (such locations must be named; more about naming in a few screens).
You may find it easier to picture the relative locations of the files in the following examples if you first examine the illustration here:
When you are linking to pages that are located on another server, or to pages that other people maintain (even if they are presently located on the same server as your files) you should always use an ABSOLUTE URL. An absolute URL includes the http://server.name/ part.
Your names must not contain space characters. Names will be interpreted by the browser, and will therefore be case-sensitive, regardless of whether the server is case-sensitive for path and filename, or not. To simplify your life creating and revising the file, and to simplify the life of anyone who might have to type the URL, it is a good idea to choose names that are short and consist of lower-case letters and numerals. Choosing meaningful names will make it easier for you to work on the file.
When you choose the text to enclose within the NAME anchor tag, remember that Netscape will not display that enclosed text any differently than it would have otherwise, but that many versions of Lynx will emphasize that text, making it look like a non-selected link.
Once the destination has been named, setting up a link to jump to that named location merely requires an HREF anchor tag with the correct URL:
While viewing the source, look for the anchor tags within the Body section, and observe their effects on the displayed page. This is the method by which you can provide shortcuts down into a larger file, functioning as a table of contents. This exercise also introduces the CENTER tags, which provide horizontal centering of the text and images that are within the block. Review the entire page; are there any tags whose meaning and effects you do not understand? We will discuss the &...; constructs (e.g., " ") later.
Dick Piccard revised this file (http://www.ohiou.edu/pagemasters/class/html1/anchor.html) on November 2, 2000.
Please E-mail any comments or suggestions to acatec@www.ohiou.edu.