Links |
One of the features that makes the World-Wide Web so powerful is the
capability of linking different pages of
information together. In HTML, this feature is implemented by
the anchor tag "a
." For example, the code
This is a sample link to the <a href="/">Department of Mathematics</a> at Texas A&M University.
is formatted by your browser like this:
This is a sample link to the Department of Mathematics at Texas A&M University.
The text between the start and end "a
" tags is typically
displayed by the browser in color or underlined. When the user
selects the link (typically by clicking the mouse on it), the
browser fetches the file specified by the href
attribute.
It is also possible to link to a named location in the middle of a document. For example, the code
Consult the NCSA documentation for
<a href="
http://www.ncsa.uiuc.edu/General/Internet/WWW/HTMLPrimerAll.html#LI2
">more
information about links.</a>
makes a link to the section named LI2
in the document with
URL http://www.ncsa.uiuc.edu/General/Internet/WWW/HTMLPrimerAll.html
.
Your browser formats this code as follows:
Consult the NCSA documentation for more information about links.
The hash mark #
indicates a link to a named section of a
document. You can name a location of your own home page by code
like this:
<a name="target">this is a special place</a>
and then link to it via
<a href="#target">go to the special place</a>.
Links |