MIS 114

Web Page Essentials

Project 4: Adding Links to Your Document

Lesson 1: Adding Links

Below is the HTML to link to UAH's home page file, "index.html" on the WWW, displaying the reference text, UAH home page. (Note, the file name can be omitted, since it has the default name, index.html.)
<A HREF="http://www.uah.edu/">UAH home page</A>
The above code is displayed by a web browser as:
UAH home page

Enter the following HTML code to create a link to a file named "cas.htm" on your local PC with the reference in viewer's browser appearing as: File on local T: drive. [This type of link is NOT accessible over the WWW! A browser can only access files on the local computer's hard, diskette, or network drives. The link in this example is accessible to any PC on UAH's Administrative Science Building's LAN (local area network). It is NOT accessible to a computer accessing this page over the Internet.]

<A HREF="file://localhost/T:/cas.htm" target="_blank">File on local T: drive</A>

Only the reference text, "File on local T: drive" is displayed by the web browser, the target value forces the page to open in a new window:
File on local T: drive

 

The HTML link to the NASA's public ftp site on the WWW, gives , Linux Online. (From this site you can download the Linux operating system kernel, networking tools, applications, and documentation files.)
<A HREF="ftp://ftp.linux.org/pub/">Linux Online</A>
The above HTML appears in a browser window only as:
Linux Online

 

If you are not able to access the above FTP site due to heavy demand or if it is temporarily off-line, try our own public "anonymous" FTP server:
<A HREF="ftp://aslnx2.asb.uah.edu/pub/">CAS FTP Server</A>
Noting that the above code is displayed by a browser as:
CAS FTP Server

 

Enter the following to create a link to the University of Minnesota's Gopher site, with the reference text, Information About Gopher. (Click on the Information About Gopher folder to access Gopher files, folders, and search engines.)
<A HREF="gopher://gopher.tc.umn.edu:70/11/">Information About Gopher</A>

The above HTML appears in a browser window only as:
Information About Gopher
Make a telnet link to a remote host which allows guest logins or to one that you know your readers have an account. For example, after giving readers instructions to use "classbbs" as their login id and telling them to then enter either their own Userid or to use "guest" as both their Userid and password; you can create a web link to access our classbbs. Enter "classbbs" to access the MIS 110/112/114 electronic bulletin board.
<A HREF="telnet://aslnx1.asb.uah.edu">electronic bulletin board</A>.

The above HTML appears in a browser window only as (no longer a valid link):
electronic bulletin board.
Make an email link an Internet Email address as follows, with the text, "send Alan Whitten a note".
send <A HREF="mailto:userid@email.uah.edu">Alan Whitten</A> a note
The above HTML appears in a browser window only as below, but will only work if your browser is email enabled and userid is Mr. Whitten's actual username:
send Alan Whitten a note

Note to UAH ASB lab users: Netscape's email and UseNet features are not enabled in ASB 207, 211, or 352.


A UseNet link to a chocolate food site is entered, with the text, Chocolate News as:
<A HREF="news:rec.food.chocolate">Chocolate News</A>

The above HTML appears in a browser window only as below, but will only work if your browser is email enabled:
Chocolate News


Lesson 2: Adding Anchors to Your Document

A link to a location in the current web page is referred to as an anchor.
The following HTML was entered just above the first two lessons' headers to make "Lesson 1" and "Lesson 2" anchor names for those locations in this document:
<A NAME="Lesson 1"></A>
<A NAME="Lesson 2"></A>

Lesson 3: Creating a Reference within Your Document

The following was entered to create these clickable links to those anchors, Go back to Lesson 1 and Go back to Lesson 2.
<A HREF="#Lesson 1">Go back to Lesson 1</A>
<A HREF="#Lesson 2">Go back to Lesson 2</A>

Note, only the anchor reference text appears in the browser:
Go back to Lesson 1
Go back to Lesson 2

Lesson 4: Referencing an Anchor in a Link to Another Document

Not only can links be made to anchors in the current document, they can be made to anchors in another web page document on the same computer.
<A NAME="Project 4"></A>
was entered on the appropriate line in the contents.htm file to create an anchor to that part of the document.

In this page a link was created to that anchor with:

<A HREF="contents.htm#Project 4">Project 4's Anchor on the Contents Page</A>
using, Project 4's Anchor on the Contents Page as the reference text.

Lesson 5: Creating a Link to a Document on Another Server

Lessons Two, Three, and Four dealt with how to create and use links within a document and to local documents on your own PC's drives (hard, diskette, LAN).

Let's review Lesson 1. To create a link to a Jason Borneman's page, Creating HTML, you merely need to enter:  

<A HREF="http://www.netusa1.net/~jbornema/html.html">Creating HTML</A>

A link to that same document can be made using any referencing text you choose. Let's create another link to that same page using, "Borneman's HTML Guide" as the referencing text, just to show we can do it, by entering:  

<A HREF="http://www.netusa1.net/~jbornema/html.html">Borneman's HTML Guide</A>

Lesson 6: Creating a Formatted Link

See your textbook, pages 80-83, for a short cut to creating formatted links and a chapter summary.

You must be very careful when typing in any Internet address, there is absolutely no margin for error. It is recommended, you use your browser to visit that site, copy its URL from your browser's Location bar, then paste it into your HTML document. While you are free to enter any text, i.e., "Creating HTML" and "Borneman's HTML Guide" in our examples above, you should use text that meaningfully identifies the links you create.


Continue to Project 5 or go back to the Table of Contents.
Last updated: Nov. 9, 1998.