Adding Bookmarks
Most links lead from one page to another. When you make the jump to a new page, the browser plunks you down at the very top of the page. But you can also create links to specific parts of a page. This is particularly useful if you create long, scrolling pages and you want to direct your visitors’ attention to a particular passage.
You can create links to another position on the current page (see Figure 8-7), or to a specific place in another web page. The place you send your reader is technically called a fragment.

Figure 8-7. This FAQ (frequently asked questions) page is an example of bookmarks at work. Here, the entire FAQ is a single long page, with a series of bookmark links at the top that let you jump to just the topic you’re interested in. You could break an FAQ into separate pages, but readers wouldn’t be able to scan through the whole list of questions, and they wouldn’t have a way to print the entire document at once.
Creating a link that points to a fragment is a two-step process. First, you need to identify the fragment. You do this with the id attribute, which assigns a unique name to any HTML element on a page.
For example, imagine you want to send a visitor to the third level-3 heading in a web page named sales.htm. Initially, the markup looks like this:
... <h3>Pet Canaries</h3> <p>Pet canary sales have plummeted in the developed world, due in large part ...