B.6 Linking

This is what makes hypertext hyper. It is also the reason to use HTML in the first place. If you like to read, get a book. If you need to connect to various references, hypertext is the way to go. HTML links text and/or images to other documents or other parts of the same document using anchors.

The hypertext tag is <A> for anchor; the reference part of tag is HREF="File" . The hypertext reference contains the pathname (relative or absolute) of the document (file) you are trying to access.

B.6.1 Creating a Link

If you can get this next bit, you have mastered the magic of hypertext. Notice that the cue to the user does not have to be the pathname to the link. (When the Web was young, site builders did not understand this and often would spell out the path on the Web page, thus causing anxiety in the user.) In the example below, newfile.html is referred to in the text as My Special Page .

All hypertext link tags take this form:

<A HREF="filename.html">Hot Link</A>

Sample reference:

<A HREF="newfile.html">My File</A>

Put whatever you wish here leading to My Special Page . The same deal over here.

B.6.2 Links to a URL (Uniform Resource Locator)

The hypertext link tag is the same form for a URL as for any other link:

<A HREF="URLname.html">Hot Link</A>

The URLname portion is written exactly as it appears in the browser's URL window:


JavaScript by Example
JavaScript by Example (2nd Edition)
ISBN: 0137054890
EAN: 2147483647
Year: 2003
Pages: 150
Authors: Ellie Quigley

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net