href, fragment links, and a placeholder without href
<a href>
<a href="#fragment">
<a>placeholder</a>A link needs href to be a hyperlink. A missing href does not create a hyperlink.
| Attribute | Description |
|---|---|
href | A valid URL potentially surrounded by spaces. Omit it when the element is only a placeholder for a future link. |
hreflang | Optional hint for the language of the destination document. |
type | Optional hint for the destination MIME type. It does not change how the browser follows the link. |
- This fragment is markup only. The example.com URL is a documentation example and is not fetched here.
<nav>
<a href="#features">Features</a>
<a href="https://example.com/docs">Example docs</a>
<a>Coming soon</a>
</nav>What this markup means
The first anchor jumps to an id in the same document. The second points at a documentation URL. The third has no href, so it is not a hyperlink and should not be expected to activate like a link.
Related: Tag catalog: <a>, <button>