text

<a>

The anchor element creates a hyperlink to another page, a file, an in-page anchor, an email, or a phone number. It is the fundamental building block of the web's link graph and a key SEO signal.

<a href="https://example.com">Link text</a>

Common attributes

Attribute Purpose
href Destination URL, #fragment, mailto:, or tel:
target Where to open: _self, _blank, _parent, _top
rel Relationship: noopener, nofollow, sponsored, ugc
download Prompts download; optional filename value
hreflang Language of the linked resource

Examples

<a href="/about">About</a>

Relative in-site link

<a href="https://ex.com" target="_blank" rel="noopener">External</a>

Opens in a new tab safely

<a href="mailto:[email protected]">Email us</a>

Opens the mail client

<a href="#pricing">Jump to pricing</a>

In-page anchor to id="pricing"

Gotcha

Always add rel="noopener" (or noreferrer) with target="_blank" — otherwise the opened page can access window.opener. An without href is not a link and gets no keyboard focus — use a

Related tags

← All HTML tags · CSS selectors · HTML entities