Container for navigation links. Learn more →
<a> ElementThe anchor element creates a hyperlink to web pages, files, email addresses, phone numbers, or locations within the same page.
<a href="url">Link text</a>The href attribute specifies where the link goes. The content between the tags becomes the clickable link text.
| Attribute | Description | Values |
|---|---|---|
href | URL the link points to | URL, #id, mailto:, tel: |
target | Where to open the link | _self, _blank, _parent, _top |
rel | Relationship to linked page | noopener, noreferrer, nofollow, etc. |
download | Download instead of navigating | Optional filename |
| Attribute | Description | Values |
|---|---|---|
hreflang | Language of linked resource | Language code (e.g., en, es) |
type | MIME type of linked resource | MIME type |
ping | URLs to ping when clicked | Space-separated URLs |
referrerpolicy | Referrer information to send | no-referrer, origin, etc. |
Use target="_blank" with security attributes:
Link to an element with a specific id:
<a href="/pricing">View pricing plans</a><a href="/docs">Read the documentation</a><a href="/pricing">Click here</a><a href="/docs">Read more</a>Screen reader users often navigate by links alone, so “click here” out of context is meaningless.
Let users know when links open new windows:
<a href="https://external.com" target="_blank" rel="noopener"> External Site (opens in new tab)</a>Users navigating by keyboard need to see which link is focused. Style focus states, don’t remove them:
a:focus { outline: 2px solid blue; outline-offset: 2px;}| Browser | Version | Notes |
|---|---|---|
| Chrome | 1+ | Full support |
| Firefox | 1+ | Full support |
| Safari | 1+ | Full support |
| Edge | 12+ | Full support |
| IE | 3+ | Full support |
The <a> element has been supported since the earliest browsers.
Container for navigation links. Learn more →
For actions (not navigation). Use <a> for links, <button> for actions.
Learn more →