6.6 Navigation Within a Web Page

You might recall from Figure 6.1 that there are three basic types of values for an a element’s href attribute. We’ve already talked about an absolute URL value and a relative URL value. In both of those cases, the target is a web page separate from the current web page. The third type of href value shown in Figure 6.1 is for when you want a link that takes the user to some specified point within the current web page. That can be particularly useful for long web pages, so the user can quickly jump to designated destinations within the web page. For example, note the blue links near the top of the Clock Tower web page in FIGURE 6.6. If the user clicks the Clock Tower Photograph link, then the web page scrolls ...

Get Web Programming with HTML5, CSS, and JavaScript 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.