![]()
<A ...>
<ADDRESS>
<APPLET
...>
<AREA
...>
The Anchor element is the essence of HTML. It is marked text
that is the start and/or destination of a hypertext link. Anchor
elements are defined by the <A> element. The <A>
element accepts several attributes, but either the NAME or HREF
attribute is required.
Attributes of the <A> element :
HREF
If the HREF attribute is present, the text between the opening
and closing anchor elements becomes hypertext. If this hypertext
is clicked by visitors, they are linked (taken) to the document
specified by the value of the attribute.
Example :
See <A HREF="http://www.mohaniyer.com/isg.htm">
Indian Software Gurus Homepage</A> for information on how
to join the ring.
In this example, selecting "Indian Software Gurus
Homepage" takes you to the document
http://www.mohaniyer.com/isg.htm
With the HREF attribute, the form HREF="#identifier"
can refer to another anchor in the same document.
Example : The <A
HREF="ha.htm#a">Anchor</A> describes the
<A> anchor tag. In this example, selecting
"Anchor" takes the reader to another anchor (i.e. <A
NAME = "a">Anchor</A>) in the document ha.htm.
The NAME attribute is described below. If the anchor is in
another document and the HREF attribute provides a partial URL,
the new document will be resolved from either the present
document, or from any specified base address.
Several other forms of the HREF attribute are permitted by
browsers. They are as follows :
<A HREF="http://..."> Makes a link to another
document located on a World Wide Web server.
<A HREF="ftp://..."> Makes a link to an ftp site.
<A HREF="gopher://...> Makes a link to a gopher
server.
<A HREF="mailto:..."> Activating such a link
would bring up the browsers mailing dialog (or registered mail
program) allowing the user to send mail messages to the author of
the document, or whoevers address follows the mailto attribute.
<A HREF="news:..."> Makes a link to a newsgroup.
<A HREF="newsrc:..."> Makes a link to a specific
newsrc file.
<A HREF="nntp://..."> Can be used to specify a
different news server to that which the user may normally use.
<A HREF="telnet://..."> Activating such a link
would initiate a telnet session (using an external application)
to the machine specified after the telnet:// label.
<A HREF="wais://..."> Makes a link that connects
to a specified WAIS index server.
NAME
If present, the NAME attribute allows the anchor to be the target
of a link. It is similar to a bookmark. The value of the NAME
attribute is an identifier for the anchor. Identifiers are
arbitrary strings but must be unique within the HTML document.
Example : <A
NAME=IMG>IMG</A> is a frequently used tag.
An example of this is <A
HREF=#IMG>IMG</A>.
Another document can then make a reference explicitly to this
anchor by putting the identifier after the address, separated by
a hash sign :
<A HREF=ha.htm#IMG>
TITLE
The Title attribute is informational only (unless used with a
mailto: attribute). If present, the Title attribute should
provide the title of the document whose address is given by the
HREF attribute. The Title attribute is useful for at least two
reasons. The HTML user agent may display the title of the
document prior to retrieving it, for example, as a margin note or
on a small box while the mouse is over the anchor, or while the
document is being loaded. Another reason is that documents that
are not marked up text, such as graphics, plain text, FTP and
Gopher menus, do not have titles. The TITLE attribute can be used
to provide a title to such documents. When using the TITLE
attribute, the title should be valid and unique for the
destination document. Netscape does not support this attribute.
REL
The REL attribute specifies the forward relationship(s) described
by the hypertext link from the anchor to the target. The value is
a comma-separated list of relationship values. Values and their
semantics will be registered by the HTML registration authority.
The default relationship if none other is given is void. The REL
attribute is only used when the HREF attribute is present.
REV
The REV attribute is the same as the REL attribute, but the link
type is in the reverse direction. A link from A to B with
REL="X" expresses the same relationship as a link from
B to A with REV="X". An anchor may have both REL and
REV attributes.
TARGET
Browser windows can now have names associated with them. Links in
any window can refer to another window by name. When the link is
activated, the document referenced will appear in that named
window. If the window is not already open, the browser will open
and name a new window for you. Such an action is only supported
by Netscape and Internet Explorer. The syntax for the targeted
windows is:
<A HREF="somepage.html"
TARGET="window_name">
Link text</A>
NOTE : If the targetted document is part of a frameset, there are
various reserved names for target window available for smooth
window transition. These are : _blank (targets a
new blank window that is not named), _self
(targets the frame where the hyperlink is found), _parent
(targets the parent <FRAMESET>
of the frame where the hyperlink is found. This defaults to _self
if there is no parent document), and _top
(targets the full window before any frames are introduced. This
creates a good way to jump out of a nested sequence of framed
documents)
<A> can also take the CLASS, ID and STYLE attributes to
allow style sheet definitions to be applied to it. For more
details of these attributes, refer to the Style Sheets topic. The <A> element
style can also be controlled by using the Anchor pseudo-elements
within a style sheet definition. Within a style sheet definition,
provided by the <STYLE>
element, the pseudo-classes A:link, A:visited and A:active can be
used to set the text style of links, visited links and active
links respectively (just as the LINK, ALINK and VLINK attributes
of the <BODY>
element do for those browsers that do not support style sheets)
The Address element specifies such information as address,
signature and authorship, often at the top or bottom of a
document. Typically, an Address is rendered in an italic typeface
and may be indented. It carries an implied paragraph break before
and after the text enclosed.
Example :
<ADDRESS>
Mr. Bill Gates<BR>
Microsoft <BR>
Redmond<BR>
Washington<BR>
WA 99999<BR>
U.S.A.
</ADDRESS>
<ADDRESS> can also take the CLASS, ID and STYLE attributes
to allow style sheet definitions to be applied to it. For more
details of these attributes, refer to the Style Sheets topic.
To add an applet to an HTML page, you need to use the
<APPLET> HTML element.
<APPLET CODE="Geoguide.class" WIDTH=100
HEIGHT=140>
</APPLET>
This tells the viewer or browser to load the applet whose
compiled code is in Geoguide.class (in the same directory as the
current HTML document), and to set the initial size of the applet
to 100 pixels wide and 140 pixels high. Another example is given
below:
<APPLET CODEBASE ="applets/NervousText"
CODE="NervousText.class" width = 400 height = 75 align
= center >
<PARAM NAME="text" VALUE="Welcome
home">
<BLOCKQUOTE>
<HR>
If you were using a Java(tm)-enabled browser, you would see
dancing text instead of this paragraph.
<HR>
</BLOCKQUOTE>
</APPLET>
This tells the viewer or browser to load the applet whose
compiled code is in the directory applets/NervousText and the
class name is NervousText.class,
to set the initial size of the applet to 400x75 pixels, and to
align the applet in the centre of the line. The viewer/browser
must also set the applet's "text" attribute (which
customises the text this applet displays) to be "Welcome
home". If the page is viewed by a browser that cannot
execute applets, then the browser will ignore the APPLET and
PARAM elements, displaying the HTML between the
<BLOCKQUOTE> and </BLOCKQUOTE> elements. Java-enabled
browsers *ignore* that HTML.
Here's the complete syntax for the APPLET element:
<APPLET
[CODEBASE = codebaseURL]
CODE = appletFile
[ALT = alternateText]
[NAME = appletInstanceName]
WIDTH = pixels HEIGHT = pixels
[ALIGN = alignment]
[VSPACE = pixels] [HSPACE = pixels]
[<PARAM NAME = appletAttribute1 VALUE = value>]
[<PARAM NAME = appletAttribute2 VALUE = value>]
. . .
[alternateHTML]
</APPLET>
CODEBASE = codebaseURL
This optional attribute specifies the base URL of the applet --
the directory that contains the applet's code. If this attribute
is not specified, then the document's URL is used.
CODE = appletFile
This required attribute gives the name of the file that contains
the applet's compiled Applet subclass. This file is relative to
the base URL of the applet. It cannot be absolute.
ALT = alternateText
This optional attribute specifies any text that should be
displayed if the browser understands the APPLET element but
cannot run applets.
NAME = appletInstanceName
This optional attribute specifies a name for the applet instance,
which makes it possible for applets on the same page to find (and
communicate with) each other.
WIDTH = pixels HEIGHT = pixels
These required attributes give the initial width and height (in
pixels) of the applet display area, not counting any windows or
dialogs that the applet brings up.
ALIGN = alignment
This required attribute specifies the alignment of the applet.
The possible values of this attribute are the same as those for
the <IMG> element:
left, right, top, texttop, middle, absmiddle, baseline, bottom,
absbottom.
VSPACE = pixels HSPACE = pixels
These option attributes specify the number of pixels above and
below the applet (VSPACE) and on each side of the applet
(HSPACE). They're treated the same way as the IMG element's
VSPACE and HSPACE attributes.
<PARAM NAME = appletAttribute1 VALUE = value>
This element is the only way to pass the necessary parameters to
the applet.
One of an unlimited number of hotspot defiinition tags inside
the <MAP> ....
</MAP> container. There is no </AREA> closing tag.
Attributes of AREA tag are :
SHAPE = "rect/circle/polygon/default" If default is
used, it must be the last defined AREA
COORDS="x1,y1,x2,y2..." For a rectangle the coordinates
are left,top,right,bottom. For a circle, x(center), y(center),
radius. For a polygon, successive x,y coordinates of vertices
(Total number of vertices limited by the limit of 1024 characters
in the attribute)
HREF="...URL.." - Path to the hyperlink target of this
AREA, relative to the directory of the HTML file containing the
MAP definition or a fully qualified URL
ALT="..." Text that may be displayed by non-imaging
browsers.
NOHREF - Null attribute, meaning that the AREA leads nowhere. For
more information on this tag, refer to the Image Map topic.