Anchors and Links

Linking To Local File

Links allow you to jump to another location in a document or to another document. To create a link, you put in an "anchor" that states what text to display and where to jump to if a reader clicks on the text.

HTML

<a href="Overview.html">Project Overview</a>

How It Displays

Project Overview

Linking To A URL

Links can be to any URL on the Web.

HTML

<a href="http://www.nytimes.com/">
    New York Times </a>

How It Displays

New York Times

Linking To A Location Within A Document

First, name the location you want to link to by placing an anchor there:

HTML

<a name="participants">project participants</a>

How It Displays

project participants

Next, put an anchor where you want to link from, giving the name of the anchor.

HTML

<a href="#participants">Project Participants</a>

How It Displays

Project Participants

The Getting and Setting Up Email Programs page is a good example of a document using internal links.

Linking To A Location In Another Document

First, name the location you want to link to in the other document by placing an anchor there:

HTML

<a name="participants">project participants</a>

How It Displays

project participants

Next, put an anchor where you want to link from, giving the name of the other document and the name of the location in that document.

HTML

<a href="Overview.html#participants">Project Participants</a>

How It Displays

Project Participants



Specifications

From the W3Schools.Com Complete HTML/XHTML Reference: