# Anchor element

Category: [Technical SEO](https://seo-geo-glossary.com/en/glossary/category/technical-seo/) › [HTML, mobile & accessibility](https://seo-geo-glossary.com/en/glossary/category/technical-seo/html-mobile-accessibility/) · Also known as: anchor tag, a href, link element

The **anchor element** `<a>`, often called anchor tag, creates a hyperlink in HTML. The destination goes in the `href` attribute (short for hypertext reference), and the visible text between the opening and closing tag is the anchor text. In some contexts "anchor" also means a jump target inside a page.

## How does the element work?

A basic link:

```html
<a href="/guides/canonical/">Canonical tags explained</a>
```

According to MDN, `href` accepts absolute and relative URLs, fragments such as `#section`, and schemes such as `mailto:` and `tel:`. Other attributes include `target`, `rel`, `download` and `hreflang`. Google lists `nofollow`, `sponsored` and `ugc` as `rel` values for links it should treat differently.

## Why does it matter for SEO?

Google states that it can discover links only if they are `<a>` elements with an `href` attribute. Google lists `<span href>`, `onclick` handlers without `href`, `javascript:` URLs and framework attributes like `routerLink` as not recommended. It may still try to parse them, but this is not reliable. Relative URLs work.

Anchor text should be descriptive, reasonably concise and relevant to the target page. Generic text such as "click here" is discouraged. For a linked image, Google uses the `alt` text of the image as anchor text. Every important page should be linked from at least one other page.

## Example

```html
<!-- crawlable -->
<a href="/shoes/">All shoes</a>

<!-- not reliably crawlable -->
<span onclick="goTo('/shoes/')">All shoes</span>
<a onclick="goTo('/shoes/')">All shoes</a>
```

## Common mistakes

- **Click handlers instead of links.** The target is not in an `href`, so Google cannot reliably extract it.
- **Empty targets such as `href="#"`.** MDN advises a `<button>` for actions.
- **Vague link text.** "Here" tells neither users nor crawlers where the link leads.

## FAQ

**What does href stand for?**
Hypertext reference. The attribute points to the link's destination URL.

## Related terms

- [Crawlable links](https://seo-geo-glossary.com/en/glossary/crawlable-links/index.md)
- [Anchor text](https://seo-geo-glossary.com/en/glossary/anchor-text/index.md)
- [Internal linking](https://seo-geo-glossary.com/en/glossary/internal-linking/index.md)
- [Link attributes](https://seo-geo-glossary.com/en/glossary/link-attributes/index.md)

## Sources

- [<a>: The Anchor element – MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a)
- [Make your links crawlable – Google Search Central](https://developers.google.com/search/docs/crawling-indexing/links-crawlable)
- [Qualify your outbound links to Google – Google Search Central](https://developers.google.com/search/docs/crawling-indexing/qualify-outbound-links)

---

Last updated: October 7, 2026
URL: https://seo-geo-glossary.com/en/glossary/anchor-element/
