Name

a

Synopsis

<a>...</a>

Defines an anchor within the document. An anchor is used to create a hyperlink to another document or Internet resource. It can also serve to label a fragment within a document (also called a named anchor), which serves as a destination anchor for linking to a specific point in a document.

Attributes

Core (id, class, style, title), Internationalization, Events (plus onfocus, onblur)

accesskey=" character "

Assigns an access key (shortcut key command) to the link. Access keys are also used for form fields. The value is a single character. Users may access the element by hitting Alt-key (PC) or Ctrl-key (Mac).

charset=" charset "

Specifies the character encoding of the target document. See Chapter 6 for information on character sets.

coords=" x,y coordinates "

Specifies the x,y coordinates for a clickable area in an image map. The HTML 4.01 Recommendation proposes that client-side image maps be replaced by an object element containing the image and a set of anchor elements defining the “hot” areas (with shapes and coordinate attributes). This system has not yet been implemented by browsers.

href=" URL "

Specifies the URL of the destination document or web resource (such as an image, audio, PDF, or other media file).

hreflang=" language code "

Specifies the base language of the target document. See Chapter 6 for a list of two-letter language codes.

id=" text "

Gives the link a unique name (similar to the name attribute) so it can be referenced from a link, script, ...

Get Web Design in a Nutshell, 3rd 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.