Sunday, March 4, 2007

The Anchor Tag and Name Attribute

The Anchor Tag and Name Attribute ::: HTML Links in WS3 Schools: "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.

The line below defines a named anchor:
<a name="tips">Useful Tips Section</a>

You should notice that a named anchor is not displayed in a special way.

To link directly to the 'tips' section, add a # sign and the name of the anchor to the end of a URL, like this:
<a href="http://www.w3schools.com/html_links.asp#tips">Jump to the Useful Tips Section</a>

A hyperlink to the Useful Tips Section from WITHIN the file 'html_links.asp' will look like this:
<a href="#tips">Jump to the Useful Tips Section</a>"
앵커태그와 Name 속성에 대해서 WS3 School에서 찾았다. 진작에 알아두었어야 했던 것인데.

No comments:

Post a Comment