Do not nest an anchor within another A tag.
If this anchor is in a file called "nowhere.htm," you could define a link that jumps to the anchor as follows:
<H2>A Cold Autumn Day</H2></A>
<P>Jump to the second section <A HREF="nowhere.htm#section2">
The file links.htm shows this example in action in a separate window.
A Cold Autumn Day</A> in the mystery "A man from Nowhere."
A as link
A hypertext link is a piece of content that the user can click to invoke an action. The most common actions are scrolling to a different place in the current document and opening a new document. A hypertext link can contain text and/or graphics.
To define a hypertext link, use the <A> tag with an HREF attribute to indicate the start of the hypertext link, and use the </A> tag to indicate the end of the link. When the user clicks any content between the <A HREF> and </A> tags, the link is activated.
The value of the HREF attribute must be a URL. If you want the link to open a new document, the value of HREF should be the URL for the destination document. If you want to scroll the current document to a particular place, the value of HREF should be the name of the anchor to which to scroll, preceded by the # sign. If you want to open another document at an anchor, give the URL for the document, followed by #, followed by the name of the anchor.
If you want the destination document or anchor to open in a separate browser window, supply the name of the window as the value of the TARGET attribute. If the named window does not already exist, a new window opens.
Most browsers display hypertext links in a color different from that of the rest of the document so that users can easily identify them. By default, Netscape Navigator displays links in blue, and displays visited links (that is, links that have been clicked) in purple. However, you can specify the default link colors for your document by specifying values for the LINK, VLINK, and ALINK attributes of the BODY tag, as discussed in the section BODY.
You can also define actions that occur when the mouse cursor enters or leaves the region containing the link by specifing onMouseOver and onMouseOut event handlers for the link. Additionally, you can specify an onClick event handler that determines the action to occur when the user clicks a link.
A link that has not been clicked is called an unvisited link. A link that has been clicked is known as a visited or followed link. A link that is in the process of being clicked is an active link.
specifies a destination URL for the link. The most common value here is a document name or an anchor. To specify a document to open, provide the URL for the document, either as an absolute or relative URL.
An example of an absolute URL is:
HREF="http://home.netscape.com/index.html"An example of a relative URL is:
HREF="documents/nextdoc.html"To scroll the current document to an anchor, give the name of the anchor preceded by the pound (#) sign. For example:
HREF="#anchor1"To open a different document at an anchor, give the URL for the document, followed by the # sign followed by the name of the anchor. For example:
specifies a window in which to show the destination document (if the link's action is to scroll or open a document). If the named window is not already open, a new window with that name opens. Navigator 2.0
Special target values are:
- _blank opens the destination document in a new unnamed window.
- _parent opens the destination document in the parent window of the one displaying the current document.
- _self opens the destination document in the same window as the one in which the link was clicked.
- _top opens the destination document in the full body of the current window. This value can be used to ensure that the destination document takes over the full window even if the original document was displayed in a frame.
The file links.htm shows this example in action in a separate window. This file also illustrates many additional different uses of links.
P>You can find all the latest news from Netscape at
<A HREF="http://home.netscape.com/index.html">Netscape's Home Page</A>.
Last Updated: 01/26/98 21:33:44