Link Markup

Note

All instances of “link” as used in this section refer to arbitrary hyperlinks that are created with the a element. Readers who are interested in the link attribute should consult Chapter 3 and this book’s companion website.

HTML’s inline elements as a group provide nuances of meaning to words, phrases, or short passages within longer blocks of content. Apart from hyperlinks—which are the point to the whole endeavor, of course—and form elements, the best known of these are used to provide emphasis.

Form elements are explained in Chapter 13, and the semantically oriented inline elements will be explained at the end of this chapter.

There are a number of reasons to give close attention to the implementation of links:

  • Links are categorically interactive; by activating a link, the user causes something new to happen. For this reason alone, links should always be easy to distinguish from surrounding content.

  • The design cues styled into links can imply relationships to particular visitor objectives.

  • The user agent styles provided for links are based on antiquated environmental assumptions that rarely apply on contemporary sites.

Link Attributes

Link elements support the following notable attributes:

href

The beating heart of the Web’s application layer. This specifies the destination of the link, saving the user the trouble of typing or pasting URIs into the browser’s Location bar.

target

This attribute takes as its value the name of the window, tab, or frame in which the destination ...

Get HTML & CSS: The Good Parts 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.