More HTML
Links to particular places within HTML documents can
often be useful. For example, if you want to have a
link from a first document to the middle of a second
document, do something like the following:
In the second document, find the place you want to link
to. Often you want to be able to jump to the start of a
section, often a heading of some sort. Let's pretend
this is the case, that the second document is called
business.html, and that the desired heading is:
How to Get Rich in 30 Days
Add an anchor as follows. Note that the anchor tags
should go within the heading tags.
Then in the first document, perhaps called mypage.html,
add an anchor such as this:
Advice on Getting
Rich
Now there will be a link in mypage.html showing the
words "Advice on Getting Rich". When someone clicks on
this, the browser will jump to the section of
business.html starting with the "Rich30" name.
You can also use an anchor name to allow people to
click on a link to go to a certain spot within the same
document. For example, it is common to have a link
located at the bottom of a document to jump up to the
top of the document. To do this, put an anchor like the
following at the top of the body section, say around
the first heading:
Then at the bottom set up the link using something like
this:
Go to Top
In general, note that after HREF= comes a location in
double quotes, consisting of a filename followed by a #
sign and an anchor name. As seen above the filename
would be omitted if you are referencing another
location in the same document. You already know that
the # sign and anchor name can be omitted, as that
would give the usual form for a link to the top of
another document.
The following example shows first an old Web page of
mine, named index.html, and then the file compute.html.
Note how each file has a link to the top of the same
document. The first file also has two links into the
middle of the second document.
Br. David's Home Page
Office location: Physics 204
Phone extension: 2416
Email address: carlsond@acad1.stvincent.edu
Br. David is a Benedictine monk of St. Vincent
Archabbey who works primarily with computers at
St. Vincent
College. His main jobs are as follows:
- Director of the
Instructional Computing
Department
- Manages seven campus computer labs
- Manages the academic minicomputer
- Handles faculty, student computing needs
- Teaches in the
Computing &
Information Science Department
- CS101 Survey of Computers and Computing
- CS111 Computing and Information Science II
- CS221 Data Structures
- CS255 Artificial Intelligence
- CS321 Data Communications
- CS330 Computer Architecture and Operating
Systems
For more information about the various computer-related
departments at St. Vincent College, see
Computing at St. Vincent
College.
Return to the top
Computing at St. Vincent College
Director: Mr. Paul Steinhaus
Phone: 2177
This department handles administrative computing and
campus networking. In addition, it takes care of the
computer facilities in the library and the dorms.
Director: Br. David
Carlson
Phone: 2416
This department is responsible for the main college
computer labs, as well as the UNIX-based academic
minicomputer. The latter is an HP 9000 running HP-UX 10
and having over 800 users. This computer handles email
for faculty and students and provides software such
as compilers and SPSS for various courses.
Main computer labs:
- Alfred 02 Lab (PC)
- IWL, ground Alfred (Mac)
- Alfred 41 Lab (PC)
- Placid 424 Lab (Mac)
- Biology 208 Lab (Mac)
- CIS Lab, Physics 01 (PC)
- Commons 102 Lab (PC)
Chairperson: Mr. Harry Morrison
Phone: 2418
This department teaches computer science. It provides
students with individual courses, a minor, a major, and
a certificate program. The courses offered attempt to
cover most of the major fields within computing. The
major itself provides a choice of emphasis of business,
mathematical computing, or computer science.
Departmental Offerings:
- Individual service courses
- CIS Major
- Business emphasis
- Mathematical computing emphasis
- Computer science emphasis
- CIS Minor
- Certificate in CIS
Go to the top of this document
Other protocols:
The usual protocol that you see in a Web address (URL,
universal resource locator, to be technical) is http,
which stands for hypertext transfer protocol. Thus you
see Web addresses such as:
http://www.gigabit.com/u1/index.html
The http indicates the hypertext transfer protocol. The
www.gigabit.com is the host name, which in the end
resolves to a numeric address for some computer at the
gigabit company. The u1 is a directory on this
computer, and the index.html is obviously the name of
an HTML file.
Here is another URL, which is (the last I knew) a real
one. This is the address for Encyclopedia Britanica:
http://www.eb.com:180/eb.html
Do you understand the parts of this one? Note that
this example adds a number after the hostname. That
indicates a port address on this computer.
Here is another popular protocol:
ftp://ftp.mcafee.com/pub/antivirus/
The initial ftp: indicates the file transfer protocol.
Next comes the hostname, and a path (the directory
antivirus within the directory pub). This is where one
can download the updated virus signature files for
McAfee VirusScan as well as free demos. This URL is for
anonymous ftp, where you don't need an account on the
host computer. It is possible to specify the other kind
of ftp, but it is not advisable to do so since you must
put your login ID and password in as part of the URL.
(Too many people have packet sniffing programs that can
extract data from packets on the Internet. Someone
might come up with your password!)
Another protocol that you may have seen is the file
protocol. That is the one that browsers use when
you simply open a file on your local hard drive. For
example, you might see something like the following
after opening the file mypage.htm from the SAVE
directory on a diskette in drive A:
file:///A|/SAVE/MYPAGE.HTM
Note the extra slash before the drive letter and the
vertical bar after it. Also remember that in a URL you
use forward slashes, even if the file is on a PC. With
Internet Explorer, you may also be able to use the
familiar A:\SAVE\MYPAGE.HTM, without any file in front
and using backslashes.
There is also a mailto URL for a link that, when
selected, activates the user's email program in order
to send a message to the address in the link. Here is
an example:
sue@stvincent.edu
Note that some special characters cannot be directly
handled in URLs. These have to be specified using
escape codes so that they are not misunderstood by
browsers. These escape codes use a 2-digit hexadecimal
number preceded by the % sign. For example, %20 is a
space character. The escape code for this character
would need to be included in a file name containing a
space (which is allowed on a Macintosh or recent
versions of Windows). For example, you might see:
http://www.somehost.com/Web%20Files/index.html
Here the directory name is "Web Files", with a space in
it.