Define link

Define link

Define link (introduction to links and anchors)

Links are "buttons," or jumps, to other WWW documents. They may also take you to another section in the current WWW document. WWW documents may contain both textual and graphical links. Textual links are text which are emphazied by being a different color than the rest of the text, and may be underlined. Once a textual link is used, it will become another color, indicating it was used.

Graphical links are graphics which serve as links, or buttons, to other sections or documents. For example, the buttons on the left are graphical links. You can determine a graphical links two different ways. First, the mouse arrow will turn into a hand with a finger pointing towards the top of the screen. Graphcial links may also contain a colored "boxed" border arround it, which should be the same color as the textual links.

Introduction to links and anchors

HTML offers many of the conventional publishing idioms for rich text and structured documents, but what separates it from most other markup languages is its features for hypertext and interactive documents. This section introduces the link (or hyperlink, or Web link), the basic hypertext construct. A link is a connection from one Web resource to another. Although a simple concept, the link has been one of the primary forces driving the success of the Web.

A link has two ends -- called anchors -- and a direction. The link starts at the "source" anchor and points to the "destination" anchor, which may be any Web resource (e.g., an image, a video clip, a sound bite, a program, an HTML document, an element within an HTML document, etc.).

Visiting a linked resource

The default behavior associated with a link is the retrieval of another Web resource. This behavior is commonly and implicitly obtained by selecting the link (e.g., by clicking, through keyboard input, etc.).

The following HTML excerpt contains two links, one whose destination anchor is an HTML document named "chapter2.html" and the other whose destination anchor is a GIF image in the file "forest.gif":

...some text...

By activating these links (by clicking with the mouse, through keyboard input, voice commands, etc.), users may visit these resources. Note that the href attribute in each source anchor specifies the address of the destination anchor with a URI.

The destination anchor of a link may be an element within an HTML document. The destination anchor must be given an anchor name and any URI addressing this anchor must include the name as its fragment identifier.

Destination anchors in HTML documents may be specified either by the A element (naming it with the name attribute), or by any other element (naming with the id attribute).

Thus, for example, an author might create a table of contents whose entries link to header elements H2, H3, etc., in the same document.