Chapter 8. Links


  • What's in a Link?

  • Linking to a Web Page

  • Absolute versus Relative Links

  • Link Targets

  • Link Titles

  • Keyboard Shortcuts and Tab Order

  • Creating an Anchor

  • Choosing Link Colors

  • Link Destination Details

  • The Link Tag

Links are what make the World Wide Web weblike. One document on the Web can link to several other documents, and those in turn link to other documents, and so forth. The resulting structure, if diagrammed, resembles a web. The comparison has spawned many "web" terms commonly used on the Internet; for example, electronic robots that scour the Web are known as spiders.

Besides linking to other documents, you can link to just about any content that can be delivered over the Internet — media files, e-mail addresses, FTP sites, and so on.

This chapter covers the ins and outs of linking to references inside and outside the current document and how to provide more information about your documents' relationships to others on the Web.

What's in a Link?

Web links have two basic components: the link and the target, or destination.

  • The link is the tag in the main document (source) that refers to another document.

  • The target, or destination, is the document (or particular location in the document) to which the link leads.

For example, suppose the Acme Games website reviews video games, and the site posts an extremely positive review of a game by On Target Games. Acme could put a link in the review on its site, leading to the game's product page on On Target's site. Such an ...

Get HTML, XHTML, and CSS Bible, Fifth Edition 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.