6.8 a Element Additional Details

There are just a couple more things to discuss about links that don’t quite fit with the earlier sections. Previously, we discussed how to link to a different web page and also how to link to a specified location within the current web page. It’s also legal to combine those techniques and link to a specified location within a different web page.

Linking to a Specified Location Within a Different Web Page

To link to a specified location within a different web page, use the href attribute to specify the other page (using an absolute url with http or a relative URL) and then append a # value to specify the location within that page. To explain that more fully, we need an example. Given the following directory ...

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.