Links and buttons

Introduction

Links and buttons are some of the most fundamental web content elements we have. If we want a user to interact with something, we use a link or a button to make that happen. It’s safe to say there are millions of these elements on the worldwide web. So, if these elements are implemented incorrectly, they become one of the most severe barriers to accessibility.

Illustration of Aine

Aine has arthritis in her hands and uses a keyboard to navigate the web. If she comes across a button online, she uses the Space bar to activate it. Sometimes it’s not really a button however, it’s a link that’s been designed to look like a button to give it more prominence. When she presses the Space bar, nothing happens.

The (important) distinction between links and buttons

Over the years, as the internet and digital design has evolved, the distinction between what’s a link and what’s a button has become blurred. This is particularly problematic for keyboard users because they have trouble activating a link or a button if it doesn’t act in the expected way. For example, if they encounter something that looks like a typical button, they would press the Enter key to activate it. If in fact it’s really a link then nothing will happen. This is confusing. They would likely go on to try using their space bar, but it has created unnecessary friction to their experience.

Basic rules for links and buttons

If something acts like a button – submitting a form, or closing a dialogue box – it should look, act and be built like a button. If it is a regular link that takes a user to an external page or document, it should likewise, look, act and be built like a link.

Think of it like a door. If it has a handle, you’d expect to pull it. Or, if it has a flat panel, you’d try pushing it. If you push, or pull and the opposite result happens (or worse, nothing happens at all) it would be pretty frustrating.

Elements of a button and a link

Buttons

  • Styling – tend to be big and bold and housed in a coloured shape, such as a rounded rectangle.
  • Code – the ‘button element’ must be used.
  • Effect – perform an action, such as submit, buy, or start.

Links

  • Styling – usually text with an embellishment such as, underline, bold or larger font.
  • Code – should always use the ‘anchor element’.
  • Effect – take the user somewhere. Unlike buttons, if you right click it on a desktop, it should be possible to open a new tab, copy the address or bookmark it.

Writing effective links and calls to action text

Screen reader users often tab between links to help them understand what’s on the page. Therefore, link text must describe both its purpose and destination, in the most concise way.

Links should also:

  • make sense in isolation
  • not include the word ‘click’, which assumes users are using a mouse.

Here’s an example of an incorrect list of links on the mortgages page on our website:

  1. Find out more
  2. Find out more
  3. Find out more
  4. Find out more

This list is incorrect. It wouldn’t be useful for a screen reader user, because each link means nothing out of context.

Now consider:

  1. Find out more about mortgages
  2. Use our mortgage calculator
  3. Decide which mortgage suits you
  4. Download our mortgage application pack

This list on the same page would be useful. It’s describes what and where each link takes a user. Additionally, it allows a screen reader user to:

  • Navigate confidently to the place on a page they need.
  • Get a sense of what the page is offering as they go.
  • Save time, by allowing a first letter search to call up a relevant link.

Example images or assets

Suggested images – links/buttons/calls to action

Things to check

Have you?

  • Only included one primary link/action/button per page?
  • Made any links look and act like links, and the same for buttons?
    Try the ‘right click test’: does it make sense to right click and open in a new tab? If not, it’s a button.
  • Checked the correct HTML is provided for each link and button?
  • Made sure users tab to navigate between links, and active a link by pressing the Enter on the keyboard and Space bar for buttons?
  • Checked the links activate hover and focus states with either a mouse or a keyboard?
  • Checked that when a link opens a new tab, or takes the user out of the current format or application, this indicated by descriptive link text?
  • Made the link and button text:
    • 2 to 4 words
    • active, ideally start with an action word
    • meaningful – never “Click here”
    • specific: “get started” is too vague and misleads users
    • reflect the destination content
    • sentence case
    • reflect destination page title and page content
    • is in clear language, that’s consistent with other content
  • Put links in useful positions where they make sense to screen reader users?
  • Made sure all icons and images that have linked got title attributes for screen readers?
Did you find this page helpful?