HTML and CSS Reference
The first example is an absolute or complete URL. It includes every part
of the URL format: protocol, server, and pathname of the document.
While absolute URLs leave nothing to the imagination, they can lead to
big headaches when you move documents to another directory or serv-
er. Fortunately, browsers also let you use relative URLs and automat-
ically fill in any missing portions with respective parts from the current
document's base URL. The second example is the simplest relative URL
of all; with it, the browser assumes that the price_list.html document is
located on the same server, in the same directory as the current doc-
ument, and uses the same network protocol ( http ). Similarly, example
three is a relative URL which looks up and into the /figs directory for a
Although appearances may deceive, the last FTP example URL actually
is absolute; it points directly at the contents of the /pub directory.
Moreover, the ftp protocol specification in the example accesses differ-
ent software on the server than the http protocol in the other examples.
The anchor ( <a> ) tag is the HTML/XHTML feature for defining both the
source and the destination of a hyperlink. [*] You'll most often see and
use the <a> tag with its href attribute to define a source hyperlink. The
value of the href attribute is the URL of the destination.
[*] The nomenclature here is a bit unfortunate: the "anchor" tag should mark just a destination, not the
jumping-off point of a hyperlink, too. You "drop anchor"; you don't jump off one. We won't even mention
the atrociously confusing terminology the W3C uses for the various parts of a hyperlink, except to say
that someone got things all "bass-ackward."
The contents of the source <a> tagthe words and/or images between it
and its </a> end tagis the portion of the document that is specially ac-
tivated in the browser display and that users select to take a hyperlink.
These anchor contents usually look different from the surrounding con-
tent (text in a different color or underlined, images with specially colored
borders, or other effects), and the mouse-pointer icon changes when