Dreamweaver Banner

Anchor

Part A | Part B | Part C

The <a> tag defines a hyperlink, which is used to link from one page to another. An anchor can be used in three ways:

Ancher Tag Attributes:

The most important attribute of the <a> element is the href attribute, which indicates the link’s destination.

Part A

By default, hyperlinks will appear as follows in all browsers:

Tips of Using Anchor Tag:

Different Ancher Usage Between HTML 4.01 and HTML5

In HTML 4.01, the <a> tag could be either a hyperlink or an anchor. In HTML5, the <a> tag is always a hyperlink, but if it doesn't have href attribute, it is only a placeholder for a hyperlink. HTML5 has some new attributes, and some HTML 4.01 attributes are no longer supported.

Named Anchors in HTML5

The traditional way to create named anchors (bookmarks) on a page was to use <a name="top">Top of page</a>. If you are working in HTML5 you'll find that your html validator will indicate this as an error, although it will still work in current browsers. In an HTML5 document, you need give the anchor/bookmark an ID and target that in your link.

Try<a href="#top">Top of page</a>

Part B

Linking to a Specific Place in a Document

You can use the Properties inspector to link to a particular section of a document by first creating named anchors. Named anchors let you set markers in a document, which are often placed at a specific topic or at the top of a document. You can then create links to these named anchors, which quickly take your visitor to the specified position. Creating a link to a named anchor is a two-step process. First, create a named anchor; then create a link to the named anchor.

To create a named anchor: in the Document window's Design view, place the insertion point where you want the named anchor. Do one of the following:

Part C

To Link to a Named Anchor:

Back to Top | Back to Navigation Page