(w) smolweb

a: The Anchor element

The <a> HTML element (or anchor element), with its href attribute, creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.

Content within each <a> should indicate the link’s destination. If the href attribute is present, pressing the enter key while focused on the <a> element will activate it.

Attributes

Specific attributes

role="link" when href attribute is present, otherwise generic

download="[filename]" causes the browser to treat the linked URL as a download. Can be used with or without a filename value. The filename will be proposed to save the file locally.

href="[URL]" the URL that the hyperlink points to. Links are not restricted to HTTP-based URLs — they can use any URL scheme supported by browsers:

hreflang="[lang]" hints at the human language of the linked URL. Allowed values are defined by RFC 5646

referrerpolicy="[type of policy]" defines part of the referrer to send when following the link.

target="[target value]" Where to display the linked URL, as the name for a browsing context (a tab, window). The following keywords have special meanings for where to load the URL:

`type=“[mime type]” Hints at the linked URL’s format with a MIME type.

Global attributes

role="[semantic-role]"

accesskey="[key]"

autofocus

class="[classname]"

dir="[auto/ltr/rtl]"

hidden

id="[identifier]"

itemid="[global-identifier]"

itemprop="[property-name]"

itemscope itemtype="[url of the vocabulary]"

lang="[language-code]"

tabindex="[num index]"

title="[Title]"

Example

<a href="https://smolweb.org" target="_blank" referrerpolicy="origin">SmolWeb</a>