Using aria-label for link purpose (2024)

This is an outdated draft.

Current information is available from the WAI website: w3.org/WAI
In 2020, the latest version of this information was at w3.org/WAI/WCAG21/Techniques/aria/ARIA8

Contents

  • 1 Status
  • 2 Applicability
  • 3 WCAG references
  • 4 User Agent and Assistive Technology Support Notes [To be published separately]
  • 5 Description
  • 6 Examples
    • 6.1 Example 1:
  • 7 Resources
    • 7.1 Related Techniques
  • 8 Tests
    • 8.1 Procedure
    • 8.2 Expected Results

Status

This is an outdated draft.

Current information is available from the WAI website: w3.org/WAI
In 2020, the latest version of this information was at w3.org/WAI/WCAG21/Techniques/aria/ARIA8

Applicability

Technologies supporting WAI-ARIA.

WCAG references

User Agent and Assistive Technology Support Notes [To be published separately]

Support of aria-label on links:

  • Jaws V.11 and greater has complete support.
  • ChromeVox V.1 and greater has complete support
  • VoiceOver V.3 and greater ??

Description

The objective of this technique is to describe the purpose of a link using the aria-label attribute. The aria-label attribute provides a way to place a descriptive text label on an object, such as a link, when there are no elements visible on the page that describe the object. If descriptive elements are visible on the page, the aria-labelledby attribute should be used instead of aria-label. Providing a descriptive text label lets a user distinguish the link from links in the Web page that lead to other destinations and helps the user determine whether to follow the link. In some assistive technologies the aria-label value will show in the list of links instead of the actual link text.

Per the WAI-ARIA specification and the HTML to Platform Accessibility APIs Implementation Guide, the aria-label text will override the text supplied within the link. As such the text supplied will be used instead of the link text by AT. Due to this it is recommended to start the text used in aria-label with the text used within the link. This will allow consistent communication between users.

Examples

Example 1:

Describing the purpose of a link in HTML using the aria-label element. In some situations, designers may choose to lessen the visual appearance of links on a page by using shorter, repeated link text such as "read more". These situations provide a good use case for aria-label in that the simpler, non-descriptive "read more" text on the page can be replaced with a more descriptive label of the link. The words 'read more' are repeated in the aria-label (which replaces the original anchor text of "[Read more...]") to allow consistent communication between users.

 <h4>Neighborhood News</h4> <p>Seminole tax hike: Seminole city managers are proposing a 75% increase in property taxes for the coming fiscal year. <a href="taxhike.html" aria-label="Read more about Seminole tax hike">[Read more...]</a> </p> <p>Baby Mayor: Seminole voters elect the city's youngest mayor ever by voting in 3 year old Willy "Dusty" Williams in yesterday's mayoral election. <a href="babymayor.html" aria-label="Read more about Seminole's new baby mayor">[Read more...]</a> </p> 

Resources

Related Techniques

Tests

Procedure

For link elements that use aria-label

  1. Check that the value of the aria-label attribute properly describes the purpose of the link element.

Expected Results

  • #1 is true
Using aria-label for link purpose (2024)

FAQs

Should I use aria-label for links? ›

The aria-label attribute on links ( a elements with a href attribute) should only be used when, for whatever reason, it is not possible or not desirable to use perceivable link text. (This includes the alt attribute in image links.)

What is the purpose of aria link? ›

Providing a descriptive text label lets a user distinguish the link from links in the Web page that lead to other destinations and helps the user determine whether to follow the link. In some assistive technologies the aria-label value will show in the list of links instead of the actual link text.

What is the purpose of using an aria-label? ›

The aria-label attribute provides the text label for an object, such as a button. When a screen reader encounters the object, the aria-label text is read so that the user will know what it is.

How do you label links for accessibility? ›

Consider these guidelines when writing link text:
  1. Avoid link text like “Click Here,” “More,” and “Read More.” These kinds of links can be confusing when a screen reader reads them out of context.
  2. Use unique link text where possible. ...
  3. It is OK to link a full sentence, but avoid longer.
  4. Use judgment when linking full URLs.

Is aria-label good for SEO? ›

SEO. Aria-labels can also help with search engine optimization (SEO). Including relevant keywords in aria-labels can make it easier for search engines like Google to understand the purpose and meaning of different elements on a page.

Does aria affect SEO? ›

In addition to WCAG, another accessibility web standard related to SEO is Accessible Rich Internet Applications (ARIA). It's a code attribute that expands HTML's capabilities to make it easier to optimize your site for screen readers.

What is the difference between a button and a link in aria? ›

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.

When should we use an aria attribute? ›

ARIA is useful for revising or correcting the role of an element when a different role is necessary to expose to users. However, it is rarely in the user or author's best interest to try and use ARIA to override an interactive element, for instance a button , with a role generally exposed by a non-interactive element.

What is aria hidden on links? ›

Description. The aria-hidden attribute can be used to hide non-interactive content from the accessibility API. Adding aria-hidden="true" to an element removes that element and all of its children from the accessibility tree.

What is the difference between Accessibility label and aria-label? ›

By default, an HTML element will use its text content as the accessibility label. If an element has aria-label , the accessible name becomes the string that it's passed in the attribute.

What is aria-label vs label? ›

The attribute doesn't replace the div, so a screen reader will read out the div text and the label associated with the input. Use a <label> . It is specifically for associating text with a form control. aria-label is designed for providing a text description of some content which a screen reader can't read out.

What is the difference between alt text and aria-label? ›

To sum it up, the `alt` attribute gives alternative text for non-text content, while the `aria-label` attribute gives a textual label for an element without a visible label. Both attributes make web content more accessible, but they are used in different contexts.

What is the best practice for link text? ›

Keep link text short where possible. Don't write lengthy link text such as a sentence or short paragraph. Place important words at the beginning of the link text.

How do you label a link in HTML? ›

Chapter Summary
  1. Use the <a> element to define a link.
  2. Use the href attribute to define the link address.
  3. Use the target attribute to define where to open the linked document.
  4. Use the <img> element (inside <a> ) to use an image as a link.

Do anchor tags need aria labels? ›

TL;DR. It's common to display multiple links with the same text on a web page — such as 'read more' in a list of blog posts. To improve the web page experience for people who use screen readers and accessibility tools, add an aria-label to the anchor element with text that differentiates the content of the onward links ...

What should I put in aria-label? ›

The aria-label should be used to provide a text alternative to an element that has no visible text on the screen.

Should I use alt or aria-label? ›

For the HTML <img> element, use the alt attribute. For all other elements with the img role, use aria-labelledby if a visible label is present, otherwise use aria-label .

Should I use title or aria-label on button? ›

The title attribute is only partly supported by browsers and assistive technologies. Although it is an accepted technique, it is preferable to use the aria-label attribute. A link or button can be made more explicit using the title attribute: Add the title attribute to the <a> , <button> or <input /> tag.

Top Articles
Latest Posts
Article information

Author: Foster Heidenreich CPA

Last Updated:

Views: 6604

Rating: 4.6 / 5 (76 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Foster Heidenreich CPA

Birthday: 1995-01-14

Address: 55021 Usha Garden, North Larisa, DE 19209

Phone: +6812240846623

Job: Corporate Healthcare Strategist

Hobby: Singing, Listening to music, Rafting, LARPing, Gardening, Quilting, Rappelling

Introduction: My name is Foster Heidenreich CPA, I am a delightful, quaint, glorious, quaint, faithful, enchanting, fine person who loves writing and wants to share my knowledge and understanding with you.