COIN74A - Named Anchors Tutorial


DW Cover


Named Anchors Tutorial

A named anchor is a hidden label that may be placed anywhere in the body of your document. It is used in conjunction with a link which is commonly used to jump to specific locations within a document. The link may be located within the document containing the named anchor or within another document.

For example, a named anchor may be inserted at the top of the document and a link is added at the bottom of the document. When the link is clicked the part of the document that contains the named anchor is brought into view.

To insert a named anchor, click on the location within the page where you would like it to be added. It must be within the <body> tag, not in the <head> tag. From the DW menubar select: Insert-> Named Anchor. In the popup enter the a name for the anchor. We will call it top and we will put it at the next to the main heading of the document.

Next, we create a link to that named anchor. In our case we will type in the word, Top, at the bottom of the page. To create the link, highlight the text then enter #top in the PI Link box. The # sign says that the link is a named anchor and the text following it is the named anchor. If you are using CS4 then make sure you are in HTML mode in the Property Inspector (PI) window by clicking on the HTML button on the left.

Named Anchor

When the link is clicked the part of the document that contains the named anchor is brought into view.

A link may also jump to a named anchor located in a different document, one that does not contain the link. For example, if there is a named anchor called email which is located in contact.htm, a link in home.htm may be created to jump to the named anchor in contact.htm. The link is created and the document name followed by the named anchor are added to the link. In the Link box in the PI you would add:

Named Anchor on Different Page

Up Arrow Top