Web Design and Development
Introduction
Internet and WWW
Defining a Web site
Good and bad Web Design Features
Elements of a Web page
HTML Introduction
Initial tags
Character Formatting Tags
Paragraph Formatting tags
List Tags
Anchor Tag
Images
Tables
Frames
Forms
Other Elements

HTML uses a hyperlink to link to another document on the Web.


The Anchor Tag and the Href Attribute

HTML uses the <a> (anchor) tag to create a link to another document.

- The anchor tag tells the browser to set a hypertext link for the designated text. The text will appear in a highlighted color to indicate that it represents a link. When a reader clicks on the link, the browser pulls up the specified page or file.
- The anchor tag must have a matching end anchor tag. The text that is linked appears between the start and end tags.
- The linked file is described by its Uniform Resource Locator—its URL. The URL describes the type of file and the file's location by server name and filename.
- An anchor can point to any resource on the Web: an HTML page, an image, a sound file, a movie, etc.

The syntax of creating an anchor:

<a href="url">Text to be displayed</a>

The <a> tag is used to create an anchor to link from, the href attribute is used to address the document to link to, and the words between the open and close of the anchor tag will be displayed as a hyperlink.

The Target Attribute

With the target attribute, you can define where the linked document will be opened.

The line below will open the document in a new browser window:

<a href="http://www.geocities.com/lea_abarentos/homepage"
target="_blank">Web Page Design and Development Lecture </a>

You can target a frame by a name you have assigned it.

- "_blank" opens the new document in a new window.
- "_parent" is used in the situation where a frameset file is nested inside another frameset file. A link in one of the inner frameset documents which uses "_parent" will load the new document where the inner frameset file had been
- "_self" puts the new document in the same window and frame as the current document. "_self" works the same as if you had not used TARGET at all
"_top" loads the linked document in the topmost frame... that is, the new page fills the entire window.

The Anchor Tag and the Name Attribute

The name attribute is used to create a named anchor. When using named anchors we can create links that can jump directly into a specific section on a page, instead of letting the user scroll around to find what he/she is looking for.

Below is the syntax of a named anchor:

<a name="label">Text to be displayed</a>

The name attribute is used to create a named anchor. The name of the anchor can be any text you care to use.

Hosted by www.Geocities.ws

1