Text
Links
Published on
Description
Links navigate the user to a new page or resource. Use <a href> for navigation — never <button> or <div>. Links styled as buttons should still be anchor elements.
Example
Example (button)
Accessibility
- Links must be underlined in body text. WCAG 1.4.1 requires visual distinction beyond color alone.
- Links activate on Enter; buttons activate on Enter and Space. Using the wrong element breaks keyboard expectations.
- Do not use
aria-labelon links — it is not translated by browser translation services and is ignored by read-aloud tools. - Do not wrap
<figure>elements in links or split link text across multiple elements. - Use
aria-current="page"on links matching the current page.
References
- On Link Underlines (opens in new tab) — Adrian Roselli
- Links, Buttons, Submits, and Divs, Oh Hell (opens in new tab) — Adrian Roselli
- Styling Links and Buttons (opens in new tab) — Adrian Roselli
- Barriers from Links with ARIA (opens in new tab) — Adrian Roselli
Related
Variables
None for links