Links

Links are fundamentally the most important interactive element of a website. Making links accessible is critical to including users of all abilities.

Screen readers like JAWS and VoiceOver give users the option to read all the links on a webpage. When pulled out of context in this way, inks with meaningful text are more useful.

Unclear link text examples:

Clear link text examples:

What to do:

  1. Write links that make sense out of context. Use descriptive link text detailing the destination; not just “click here,” or other similar phrases.

  2. Link text should be made up of phrases rather than single words, so that users with limited motor control will not have difficulty hitting links.

  3. If you use an image to create links, make sure the destination, e.g., wikipedia.org, is included as an image Alt attribute.

What not to do:

  1. Don’t capitalize text as it is difficult to read. It’s all one big rectangle.

  2. Avoid special characters as they will likely not be read by screen readers.

  3. Avoid URLs as link text.

  4. Avoid forcing links to open new windows. It is disorienting for users and breaks natural fallbacks like the back button.

  5. Don’t link directly to downloads. See File Download Shortcode for sample markup.

Where there are multiple links on a page that either say the same thing or go to the same source, like a blog roll or search results page, be sure to identify links in unique ways.

  • If links point to different locations, check for title attributes to distinguish them.

  • If links have generic text “Download”, “Read more,” check for the title for ARIA attributes to provide context though aria labels.

  • Another option is to use off-screen text to hide text for screen readers only. Use with caution.

Example using aria-label:

<h4>Rock Heros</h4>
 <p>Eddie Van Halen: In 1962, the Van Halen family moved from the Netherlands to the United States,
 settling in Pasadena, California. Eddie and his older brother, Alex Van Halen, 
 were naturalized as U.S. citizens. The brothers learned to play the piano as 
 children starting at the age of six.
 <a href="eddievanhalen.html" aria-label="Read more about Eddie Van Halen">[Read more...]</a>
 </p> 

 <p>Ian Gillan: Gillan was born on 19 August 1945 at Chiswick Maternity Hospital. His father, 
 Bill, was a storekeeper at a factory in London, who came from Govan, Glasgow. One of Gillan’s 
 earliest musical memories was of his mother playing "Blue Rondo à la Turk" on the piano.
 <a href="iangillan.html" aria-label="Read more about Ian Gillan">[Read more...]</a>
 </p>

Example using aria-labeledby:

<h2 id="headline">Slayer announce global farewell tour</h2>

<p>The heavy metal band Slayer have confirmed that they will split this summer, after a global farewell tour.
   <a href="slayernews.html" aria-labelledby="headline">Read more...</a></p>

Another example using aria-labeledby:

<p id="dowload-title">Download Band Logo:
<a aria-labelledby="download-title png" href="#" id="png">PNG</a> |
<a aria-labelledby="report-title eps" href="#" id="eps">EPS</a> |
<a aria-labelledby="report-title svg" href="#" id="svg">SVG</a></p>

Example using off-screen or visually hidden text:

<h2>Download Carnegie Museum of Art Logo</h2>
<ul>
<li><a class="link-download" href="/assets/logos/eps/cmoa-logo-2.eps">Download (EPS)<span class="screen-reader-text">logo two</span></a></li>
<li><a class="link-download" href="/assets/logos/png/cmoa-logo-2.png">Download (PNG)<span class="screen-reader-text">logo two</span></a></li>
<li><a class="link-download" href="/assets/logos/svg/cmoa-logo-2.svg">Download (SVG)<span class="screen-reader-text">logo two</span></a></li>
</ul>

Resources

Read through the resources before using the target attribute. Often there is a more accessible solution.

Although changing the default link behavior is not a preferred practice, there may be some exceptions where it is appropriate. In such cases, be sure these links aren’t introducing accessibility issues.

  1. Identify links that open in new windows

  2. Check that target="_blank" is set

  3. Verify that some indication, of the action to occur, is given programmatically

Examples:

<a href="#" target="_blank" aria-label="Opens in new window">
<a href="#" target="_blank" title="Opens in new window">
<a href="#" target="_blank">Link<span class="screen-reader-text">Opens in new window</span></a>

Resources

Last updated