Anchors have a standard format that allows any Web browser to interpret a link and perform the proper function (called a method) for that type of link. Links can refer to other documents, specific locations within the same document, or can perform operations, such as retrieving a file using FTP for display by the browser. URLs can refer to a specific location by an absolute pathname, or can be relative to the current document, which is more convenient when managing a large site.
Note: You can use hypertext links to navigate through a document or to move from document to document. However, HTML does not support returning you to the anchor point of a link within a document. If you use a hypertext link within a document, and then use the Back button, you do not return to the anchor, but to the previous point that you reached through a link.
The general format of a URL is:
method://machine-name/path/foo.html
The following example would fetch the document index.html from the server www.acme.com using the HTTP protocol.
http://www.acme.com/index.html
A Uniform Resource Locator (URL) has the following format:
method://servername:port/pathname#anchor
The components of the URL are as follows:
<A HREF="URL">text_to_be_displayed_highlighted</A>
The <A HREF="URL"> tag opens the anchor link and the </A> tag closes it. All the text between those tags is displayed highlighted in some way by a web browser. A common technique is to display it underlined and in blue or some other user-selected contrasting color.
The URL part of the tag refers to the text of the URL reference as defined in the previous section. The URL text does not appear on the user's screen; it is only used when the user activates the link, usually by clicking on it with the mouse.
An example HTML segment:
For interesting products see
<A HREF="http://www.acme.com">Acme's home page.</A>
This line would produce on the user's screen:
For interesting products see Acme's home page.
There are two ways to use graphics from within an HTML document. The first is by embedding them within the document itself, so the user's screen will display the graphics within the context of the other elements of your document (such as explanatory text). This is the most common technique used by HTML designers and is called an "inline image". The syntax for specifying this is:
<IMG SRC="URL" ALT="text"
ALIGN=["top"|"middle"|"bottom"|"texttop"] ISMAP>
The elements in this syntax statement are as follows:
For example, the following line will cause the file logo.gif to be fetched from server www.oracle.com and the text Oracle Logo to be displayed if the user has graphic display turned off.
<IMG SRC="http://www.oracle.com/logo.gif" ALT="Oracle Logo">
To create a link, follow these steps:
<A NAME="named_anchor"> Text_to_link_to</A>
<H2><A NAME="intro">Introduction to Hockey</A></H2>
<A HREF="#named_anchor">Text</A>
<A HREF="#intro">Gordie Howe</A>
When the user clicks on "Gordie Howe," the browser displays the heading "Introduction to Hockey" at the top of the screen.
Note: As specified earlier in the URL syntax, a link to a section can appear in the same document or in another document. The example here describes a link to a specific section of the same document.
Go to the top of the section.
To report any problems or comments, e-mail Oracle WebServer Documentation.