liveBook · Manning

Hyperlink

As explained in Architecting Accessibility

A link is an interface element that points to another resource or location and enables navigation to it.

A link helps someone move to another page or resource. If it looks like ordinary text, has no clear keyboard focus, or says only “Read more,” people may struggle to find it or understand where it goes. Navigation menu links, inline links, and image links all need to make their purpose clear. section 5.4 section 5.6

Use an HTML <a> element for navigation and a <button> for actions such as submitting a form. A <div> or <span> with role="link" communicates link semantics to assistive technology, but still needs keyboard handling. Replacing it with a native anchor is usually simpler and more robust. section 5.4

Before changing a link’s default appearance or behavior, check what users will lose:

  • Keep links distinguishable from surrounding text. Browser underlines and link colors provide useful cues; if you remove them, supply equally clear styling rather than relying on color alone. section 5.4 section 3.1.3
  • Keep a clearly visible focus indicator and a predictable focus order. Someone navigating with Tab needs to know which link will activate next. section 5.6 section 3.1.3
  • Make the destination or purpose understandable. A detached “Read more” link can lose the context supplied by nearby content. section 5.4
  • If a link opens a new tab or window, say so. If an image is the link, give it an accessible name that describes the link’s purpose. section 5.4

Give an image link a name

For a linked LinkedIn icon, use an image with alt="Share on LinkedIn". If visible “Share on LinkedIn” text appears beside the icon inside the link, the image can instead have an empty alt attribute. section 5.4

<a href="...">
  <img src="images/li.png" alt=""> Share on LinkedIn
</a>

This anchor pairs visible link text with a decorative image whose empty alt attribute avoids repeating that text. section 5.4

TIP: Test links by tabbing through the page. Can you spot each link, see where focus is, and tell what will happen when you activate it? section 5.4 section 5.6

How Architecting Accessibility covers it

How deep it goes
Explains native link semantics and practical checks for styling, purpose, keyboard focus, image links, and new-window notices.
Examples
Contrasts default and stripped link styling, and shows linked images, vague “Read more” labels, and new-window notices.
What it assumes
Assumes basic familiarity with HTML and CSS while explaining why native link semantics and keyboard behavior matter.
What you can do after
Build it from scratch with native anchors, clear link names, visible focus, and notices when links open new windows.
How it connects
Connects links to semantic HTML, buttons, assistive technology, keyboard navigation, focus indicators, and contrast.

Also explained in

Compare how 10 books explain hyperlink →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Architecting Accessibility. The section links point to the parts of the book it draws on.