Skip to content

Links and buttons

Overview

Links and buttons serve different functions on websites and should be used appropriately. The difference is explained in the HTML: Links vs Buttons section below.  This issue applies primary to web pages.

Another issue that applies more broadly to any digital resource is: Meaningful link text. Link  text should be unique within a web page or document, should be meaningful when read out of context, and should help users to know something about their destination if they click on it.

Meaningful link text

Link text should be unique within a page, should be meaningful when read out of context, and should help users to know something about their destination if they click on it. Consider the various ways users interact with links:

  • Screen reader users sometimes navigate web pages and documents using the tab key, in which case they jump between links, buttons, and form fields. When they land on a link, their screen reader announces “link” and reads the link text. This should be sufficient information for users to form a reasonable expectation of what will happen if they follow the link.
  • Screen reader users can generate a list of links and navigate them in their order on the page, or sort them alphabetically (see screenshot below). Redundant or ambiguous link text such as “Click here” or “Read more” is meaningless in this context.
  • Users of voice input technology can select a link with a voice command like “click” followed by the link text. Therefore, it is also helpful to use unique link text that is short and easy to say.
Screenshot of JAWS Links List dialog, with multiple Click Here and Read More links
Links List dialog in JAWS screen reader software

Try to always use link text that meets the criteria explained above. For example, consider the following sentence, where the link text “click here” does not meet the criteria:

For more information about Husky Athletics, click here.

A better approach would be to rephrase the sentence so that “Husky Athletics” is the link text:

For more information, see Husky Athletics.

URLs as link text

URLs should generally be avoided as link text. They are difficult for screen reader users to understand and difficult for voice input users to express.

Short URLs can sometimes be an exception. For example, “washington.edu” is easy to understand and easy to say.

Techniques

Techniques

In HTML, links and buttons are different elements, which serve different purposes:

  • Links take the user to a new location, such as a new web page or new section of the current page.
  • Buttons trigger some action, such as showing content on the page that was previously hidden, playing a video, or submitting a form.

This distinction matters because it affects user expectations. If a screen reader announces an element as a “link” or “button,” users have expectations about what will happen when they click that element.  If something else happens, this can be disorienting.

If the wrong element (link vs button) has been used on a website, and changing it to the correct element is not feasible, its role can be overridden with the ARIA role attribute. For example:

The following element is handled as a link by screen readers.

<button role="link">

The following element is handled as a button by screen readers.

<a role="button">

Links and buttons each have additional accessibility considerations, described below.

Generally, users should have control over whether they open a link in the same browser tab or a new one. Forcing links to open in a new tab can defy users’ expectations and cause confusion, particularly for screen reader users. It also renders the browser’s Back button useless, whereas being able to browse forward and back through one’s browsing history is an extremely useful feature.

However, there are exceptions. If the user is likely to want to return to the current page, especially to the point where they left off, it is acceptable, even preferable, to open links in a new tab. The following are examples:

  • On an online form, where links lead to help pages.
  • On a secure website, where links lead to external pages and leaving the current page will result in the user being logged out of the current site.
  • On a page that serves as a hub, the primary purpose of which is to provide users with links, such as a page of search results.

If link text is added at the end of repeated blocks of text, for example, “Read more” links at the end of short teasers for articles, there are a variety of acceptable techniques for making those links more accessible. Two techniques are described below.

Technique #1: Override link text with aria-label

The aria-label attribute, if added to a link, will override the visible link text. This can be used to provide more descriptive link text specifically for screen reader users, where sighted users get the same information by visual context. In the following example, screen readers will read the value of the aria-label attribute rather than the link text:

<a href="post.php?post=632" aria-label="More on Using Meaningful Link Text">More...</a>

Technique #2:  Combine content into one label using aria-labelledby

The following example uses the aria-labelledby attribute. The value of this attribute must be one or more ids of existing elements on the page, separated by a space. This example is particularly clever as it’s self-referential. It combines the content of itself (“Read more…”) with the article title that’s provided elsewhere.

<h2 id="article1-title">Huskies Earn Top Honors</h2>
<p>Short teaser blurb goes here...</p>
<p><a id="article1-link" aria-labelledby="article1-link article1-title">Read more...</a></p>

The advantage of Technique #1 is that it offers authors more flexibility in writing a label that is meaningful and easy to read. For example, if the title of an article is long, it could be truncated in the label.  In contrast, Technique #2, since the label is created programmatically, might result in a label that is too long. However, Technique #2 is fine if it is not feasible for content authors to enter custom aria-label values for each “Read more” link.

To add links in Microsoft Office, select the text or picture that you want to display as a hyperlink. Press Ctrl+K in Windows, or Cmd+K in Mac OS. You can also right-click the text or picture and select “Hyperlink” in the shortcut menu. In the Insert Hyperlink dialog, type or paste your link in the Address field.

As described at the top of this page, be sure the link text conforms to best practices for accessibility. If the link is created from a picture, carefully consider what needs to be communicated in the picture’s alt text (for additional information about alt text, see our Images page). It is important for screen readers to know what to expect if they click on the image. This need is generally more important than knowing the content of the image, although well-written alt text can typically meet both of these needs.

If a PDF document was properly exported from an accessible version of an authoring application, the links in the document should already be active and accessible. Verification of links can be accomplished by running the Accessibility Checker built into Adobe Acrobat Pro.

Acrobat provides several ways to create active links for URLs in a PDF document including using the automated tools for remediation. To create links in a PDF document using Adobe Acrobat Pro, follow these steps:

  1. Highlight the text
  2. Right click and select “Create Link…” from the context menu
  3. In the Create Link dialog box, select either ” Go to a page view” if you are linking within the document, or ” Open a web page” if you are linking a URL, then follow the prompts to complete the task.

Below are both bad and good examples of link text being added to a Canvas page.

Example 1:  bad link text

The Canvas Insert Link dialog, with 'click here' entered into the Text field

In this example, the text “click here” fails because if read out of context, it provides no meaningful information to users about what will happen if they follow the link.

Example 2: good link text

The Canvas Insert Link dialog, with 'UW Accessible Technology' in the Text field

In this example, the link text “UW Accessible Technology” makes sense independently of context. If users encounter this link (for example) in a list of links, they know what to expect if they follow the link. They don’t need the original context to figure that out.

Changing text of course links

When adding links to pages within Canvas, the rich content editor provides two options:  External Links and Course Links. If you select Course Links, you can add links to a wide variety of course content, including pages, assignments, quizzes, discussions, and more.  When added to the current page, the default link text will be the title of that resource. This may or may not be good link text (e.g., unique on the page, easy to understand, able to stand alone independently of context).  To edit the link text for any Course Link, simply click the link and select “Link Options”. A form will appear in the sidebar where you can edit the link text.

WCAG 2.1 success criteria

The issues described on this page, and associated Techniques pages, map to the following success criteria in the W3C’s Web Content Accessibility Guidelines (WCAG) 2.1: