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
<nav>
Marks a section of major navigation links, either within the site or the current page. Use for primary menus, breadcrumbs, and pagination — not for every group of links.
<button>
Interactive control that triggers an action — submitting a form, opening a dialog, or running JavaScript. Use it for anything that does something; use <a href> for anything that navigates.
<link>
Defines a relationship between the current document and an external resource — stylesheets, icons, preloads, RSS feeds, canonical URLs, and manifest files. Lives inside <head>.
<h1>
The top-level heading, describing the main topic of the page or its sectioning root. Modern practice allows one <h1> per page (the page title) or one per sectioning element — pick a convention and stick to it.
<p>
Represents a paragraph — a block of running text separated from its neighbors. Use it for prose; do not use it as a generic wrapper for other block-level content.