Linking to a Specific Anchor

Once you have created an anchor, you can define a link so that a user’s click brings them directly to the section of the document that contains the anchor, not just the top of that document.

To create a link to an anchor:

1.
Type <a href="#anchor name">, where anchor name is the value of the name attribute in the destination’s a tag (step 2 on page 106) or the value of the destination’s id attribute (see first tip on page 106).
Figure 6.9. When the visitor points at a link with an anchor, the URL and the anchor name appear in the status bar (in the lower-left corner of the window).

2.
Type the label text, that ...

Get HTML, XHTML, & CSS, Sixth Edition: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.