Skip to Content
Creating a Website: The Missing Manual, 3rd Edition
book

Creating a Website: The Missing Manual, 3rd Edition

by Matthew MacDonald
May 2011
Beginner
584 pages
17h 42m
English
O'Reilly Media, Inc.
Content preview from Creating a Website: The Missing Manual, 3rd Edition

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.

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.

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Creating a Website: The Missing Manual, 4th Edition

Creating a Website: The Missing Manual, 4th Edition

Matthew MacDonald
Learn to Build a Website

Learn to Build a Website

Cassidy Williams, Camryn Williams

Publisher Resources

ISBN: 9781449306823Errata Page