This reference is built into PageRIJ — a live HTML, CSS & SVG authoring and learning environment.

HTML <a> element

The <a> element creates a hyperlink. With an href, it links to a destination: another page, a file, a position within the same page, an email address, or a phone number. The destination is given by the href attribute.

Without an href, an <a> is not a link at all. It becomes a placeholder anchor: it can still be styled and can still hold content, but it does not have the normal keyboard behaviour or link semantics of a hyperlink. Use a real href for navigation and a button for an action.

The target attribute controls where the destination opens. The default, _self, replaces the current page. target="_blank" opens a new tab or window. Modern browsers implicitly apply noopener for target="_blank", preventing the new page from receiving an opener reference. Writing rel="noopener" explicitly still makes that intention clear.

The rel attribute describes the relationship to the linked resource rather than where it opens. Common values include nofollow (do not treat this as an editorial endorsement for search ranking), noopener (prevents an opener reference) and noreferrer (also omits referrer information), and external (a plain hint, with no special browser behaviour of its own).

The download attribute requests a download and can suggest a filename. It generally applies to same-origin resources and blob: or data: URLs; the browser, user settings, and response headers still affect the result. href values starting with mailto: or tel: turn a link into a shortcut for composing an email or dialling a number.

A link and a <button> are easy to confuse but answer different questions. A link answers "where do I go?" — it identifies a destination and supports browser link operations such as opening in a new tab. A button answers "what happens now?" — it runs an action on the current page. Styling a button to look like a link, or a link to look like a button, does not change which one is the right element for the job.

Use link text that identifies the destination, such as Image reference. For a position on the same page, use a fragment such as href="#examples" and give the destination element id="examples". Do not nest links or interactive controls such as buttons inside a link.

Attributes: href, target, rel, download, hreflang, type, referrerpolicy, ping, GLOBALS.

Typical layout:
<p>See the <a href="https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element">image reference</a> for details.</p>
Visual representation:

See the image reference for details.