❌

Vue normale

Weekly Reading List December 1 2025

1 décembre 2025 à 13:49

The post Weekly Reading List December 1 2025 appeared first on TPGi — a Vispero company.

Weekly Reading List November 24 2025

24 novembre 2025 à 13:06

The post Weekly Reading List November 24 2025 appeared first on TPGi — a Vispero company.

Weekly Reading List November 17 2025

17 novembre 2025 à 13:59

The post Weekly Reading List November 17 2025 appeared first on TPGi — a Vispero company.

Accessible Names and Labels: Understanding What Works and What Doesn’t

14 novembre 2025 à 14:01

Defining labels for user interface (UI) components may seem straightforward, but in practice, it’s an area where accessibility issues frequently arise. Developers may assume that if a label is visible on the screen, assistive technologies like screen readers will automatically associate it with the corresponding control, but that’s not the case.

This article explores how to correctly define and associate labels and accessible names for UI elements to ensure that all users, including those relying on assistive technologies, can understand the purpose of each control.

We’ll also walk through several real-world scenarios that might look perfectly fine, yet fail to convey their purpose. By understanding these subtle pitfalls, you’ll be better equipped to create forms and interactive components that are both visually and semantically accessible.

Label

A label is text or an element (such as an icon or image with a text alternative) presented to all users to identify a component within web content.

Visible labels help users understand the purpose of form fields and interactive components. When labels are missing, unclear, or not persistent, users may be left guessing what information is required.

Text as a label:

Field with a visible label to the left

Icon as a label:

field with a search icon to the right

In most cases, visible text placed next to or within a control serves as a label that communicates the control’s purpose. However, in some cases, users may need to rely on the surrounding context to understand the control’s meaning.

The visual proximity of a label to its associated control is also important. If the label is placed too far from the control, sighted keyboard users and users of screen magnification may find it difficult to determine which label belongs to which field. Maintaining clear visual association—typically by positioning the label immediately before or above the control—supports both sighted and non-sighted users.

 

For more insights on designing effective visible labels, refer to the article, More Than Just Text – The Real Power of Labels.

Name

A name is a programmatic text (also known as an accessible name) by which assistive technologies can identify a component within web content to the user.

Every form input and interactive control must have a programmatic name so that screen readers and other assistive technologies can accurately announce its purpose to users.

The process by which an element’s accessible name is determined follows the Accessible Name and Description Computation 1.2. This algorithm establishes a hierarchy and precedence among potential naming sources. When multiple name sources are defined, assistive technologies use the one that appears first in the hierarchy and ignore the rest.

In simplified terms, the naming precedence is:

  1. aria-labelledby
  2. aria-label
  3. Native <label> element (for form controls)
  4. title attribute
  5. Other fallback methods such as placeholder text, implicit labeling, or inner content

Let’s explore each of these methods in this order.

aria-labelledby

If an aria-labelledby attribute is used, assistive technologies will use the text referenced by the specified ID(s) as the accessible name of the element.

<button aria-labelledby="addFav">❤</button>
<span id="addFav">Add to favorites</span>

Note: Although the text referenced by aria-labelledby is typically visible on the screen, it does not behave like a native <label> element, clicking on it will not move focus to the associated form input.

<span id="first_name">First Name:</span>
<input type="text" name="first_name" aria-labelledby="first_name">

aria-label

If no aria-labelledby reference is provided, the value of the aria-label attribute will be used as the accessible name.

<a href="help.html" aria-label="Help documentation">Help</a>

Note: The aria-label text is not visible on the screen; it is only exposed to assistive technologies like screen readers.

When a visible label is available, the content of the aria-label must include the visible text to conform to WCAG SC 2.5.3 Label in Name.

Explicit Label

In most cases, the best way to define an accessible name for a form <input> field is to associate it with a visible label using the HTML <label> element. This method has the broadest support across browsers and assistive technologies. It also offers the added benefit that users can click either the label or the input field to focus on the input, effectively increasing the clickable area. A larger click target is especially helpful for users with tremors or limited fine motor control, as well as for mobile users, particularly when the target is small, such as a single radio button.

<label for="first_name">First Name:</label>
<input type="text" name="first_name" id="first_name">

Title

The title attribute can be used to provide a name for form controls, but this approach is generally unreliable and not recommended. Many screen readers and assistive technologies do not consistently treat the title attribute as a replacement for a proper label, likely because it is often used to convey supplementary or non-essential information. For sighted users, the content of the title attribute is typically displayed as a tooltip when hovering the mouse over the form field.

<a title="microsoft home" href="https://www.microsoft.com/en-in/">
<img alt="" src="https://uhf.microsoft.com/images/microsoft/RE1Mu3b.png"></a>

However, there is one important exception: For <iframe> elements, the title attribute is required and must be used to provide an accessible name that describes the purpose or content of the embedded frame. Without it, screen reader users will hear a generic or empty frame announcement, offering no context.

<iframe src="promo.html" title="Promotional video about accessibility features"></iframe>

Note: In the Microsoft Edge browser, keyboard users can access the information provided by the title attribute by moving focus to the element. However, as of Chrome version 142.0.7444.135, the title attribute is not displayed on focus, meaning keyboard-only users cannot access this information.

Placeholder

While placeholder text can technically be used to provide an accessible name, it should not be relied upon as the only visible label for a form field. This is because:

  1. Placeholder text disappears when users begin typing, leaving no visible label to guide them during data entry.
  2. Placeholder text is not displayed when a field is pre-filled, making it difficult for users to review or edit their input.
  3. Placeholder text often has poor color contrast, and even when the contrast is improved, users may mistake it for actual input and skip the field.
  4. Long placeholder text may be truncated if it exceeds the width of the input field, reducing clarity.
  5. Placeholder text can become partially obscured or illegible when text is resized, such as on small screens or when using browser zoom.
<input type="search" placeholder="Search...">
<button type="submit">Search</button>

Implicit Label

In some situations, form controls cannot be labeled explicitly. For example, a content author might not know the ID of a form field generated dynamically by a script, or the script may not assign an ID at all. In such cases, the <label> element can be used as a wrapper that contains both the form control and the label text. This creates an implicit association between the label and the form control.

While this approach works, explicit labeling is generally better supported and more reliable across assistive technologies.

<label>
First name:
<input type="text" name="firstname">
</label>

Inner Content

For controls like buttons that have inner content, that content can serve as an accessible name. This might be plain text inside the button, or it could be the alt attribute of an <img> element contained within the button.

<button>
<span>Add to</span>
<img src="heart.png" alt="favorites">
</button>

Scenarios

The following are common situations where users with disabilities may have difficulty perceiving or understanding the purpose of a control due to missing, unclear, or improperly associated labels and names:

Scenario #1: title attribute is Overridden by an Empty <label> Element

A surprisingly common issue occurs when developers rely on the title attribute to label an input field but also include an empty <label> element, either wrapping the input or referencing it with the for attribute. When this happens, the title value gets ignored as a naming source because the <label> element takes precedence in the accessibility tree. The result? The input field ends up without a valid accessible name.

Example 1:

<span> First Name: </span>
<label>
<input title="First name" type="text" name="firstname">
</label>

Example 2:

<span> First Name: </span>
<label for="fname"> </label>
<input title="First name" id="fname" type="text" name="firstname">

It would look like this:

Field with a visible label to the left

Although screen readers such as NVDA and JAWS might still announce the title value (“First name edit blank”), inspecting the element’s Accessibility Tree or Computed Properties will reveal that it actually has no accessible name.

  • In Chrome or Edge, right-click on the page and select Inspect, or press F12 to open Developer Tools. You may need to switch to the the Accessibility tab.
  • In Firefox, open the Developer Tools by right-clicking the page and selecting “Inspect Element” or by pressing F12.
  • In Safari, right-click (or Control-click) anywhere on the page and select Inspect Element. In the Developer Tools, go to the Elements tab, select the element in the DOM tree you want to examine, select the Node tab, and expand the Accessibility section.

Screenshot of an element's computed properties showing no accessible name

Under Computed Properties, you’ll see the Computed Name field, which follows the Accessible Name and Description Computation hierarchy. In this hierarchy, a <label>, even an empty one, takes priority over a title attribute, which is why the title value is ignored in these cases.

Note: Users who depend on voice input tools like Windows Voice Access rely on the control’s visible or programmatic name to issue voice commands (e.g., saying “Click First Name”). Because the accessible name is missing in this case, the field becomes unreachable through voice interactions, even though it may appear to work visually and audibly for screen reader users.

Scenario #2: An empty <option> element

It’s quite common to see combo boxes (<select> elements) where the first <option> is intentionally left blank. Developers often do this to display an empty default state, but an empty option can create confusion, especially for users of assistive technologies.

Example:

<label for="cars">Choose a car:</label>
<select name="cars" id="cars">
<option></option>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>

It would look like this:

Dropdown allowing users to select a car

At first glance, this might seem harmless; it simply shows an empty selection at the top of the list. However, since <option> elements are form controls, each should have a visible and accessible name. In this example, the first option has neither.

For instance, when a screen reader user lands on this option, they may hear something like:

“list item 1 of 5” or nothing

Instead of leaving the first option empty, provide a meaningful label such as:

<option value="">Select a car</option>

This way, the control communicates its purpose clearly to everyone.

Scenario #3: Image of text with no alternative text defined inside <button> or <a>

Another common accessibility issue arises when an image of text (for example, a company), that is meant to contribute to the accessible name, is placed inside an interactive element like a <button> or <a> tag but lacks an alternative text (alt) description, users of assistive technologies will not be able to understand the control’s purpose.

Without an alt attribute or an equivalent accessible label, screen readers will simply announce it as “link” or “button,” providing no context about its destination or function.

 

Example:

<a href="https://www.microsoft.com/en-in/">
<img alt="" src="https://uhf.microsoft.com/images/microsoft/RE1Mu3b.png">
</a>

Visually, this looks fine, it displays the Microsoft logo and functions as a link to the homepage. However, for a screen reader user, it would be announced merely as “link,” which doesn’t communicate what the link does or where it leads.

To make this accessible, you can use either of the following approaches:

Approach 1: Define an Alternative Text for the Image

<a href="https://www.microsoft.com/en-in/">
<img alt="Microsoft home page" src="https://uhf.microsoft.com/images/microsoft/RE1Mu3b.png">
</a>

Approach 2: Use aria-label (or aria-labelledby) for the <a> Element

<a href=https://www.microsoft.com/en-in/ aria-label="Microsoft home page">
<img alt="" src="https://uhf.microsoft.com/images/microsoft/RE1Mu3b.png">
</a>

Note #1: If both an aria-label is defined on a <button> or <a> and an <alt> is defined on the nested <img>, the aria-label takes precedence and becomes the accessible name.

Note #2: If an image of text is used within a <button> or <a>, the accessible name must include the same text that appears visually in the image (for example, if the image displays “Submit,” the alt or aria-label should also say “Submit”).

Scenario #4: When the Label Alone Is Sufficient for Radio Buttons

When form controls such as radio buttons or checkboxes are presented in a group, a group label (typically using a <legend> within a <fieldset>) is usually required to provide additional context about what the group represents. However, there are cases where the individual labels alone fully describe the purpose of each control—making a grouped label optional.

Consider the following example:

<fieldset>
<input type="radio" id="A11Yin" name="A11Ytest">
<label for="A11Yin">I live in India</label>
<input type="radio" id="A11Yde" name="A11Ytest">
<label for="A11Yde">I live in Germany</label>
<input type="radio" id="A11Ysp" name="A11Ytest">
<label for="A11Ysp">I live in Spain</label>
</fieldset>

This would look like:

Radio buttons for country of residence

In this scenario, each label clearly communicates the purpose of the control (“I live in India,” “I live in Germany,” “I live in Spain”). Even without a grouped label like “Where do you live?”, the user can easily understand what the options represent.

However, while this works visually and semantically, it can result in repetitive or verbose announcements for screen reader users. For example, the screen reader might read “I live in India, radio button not checked,” which can become cumbersome across multiple options.

To improve clarity and conciseness, it’s better to use a grouped label with a <legend> and simplify the individual option labels.

 

<fieldset>
<legend>Where do you live?</legend>
<input type="radio" id="A11Yin" name="A11Ytest">
<label for="A11Yin">India</label>
<input type="radio" id="A11Yde" name="A11Ytest">
<label for="A11Yde">Germany </label>
<input type="radio" id="A11Ysp" name="A11Ytest">
<label for="A11Ysp">Spain </label>
</fieldset>

This would look like:

Radio buttons for country of residence

Screen readers will announce the context once (“Where do you live?”) and then read each option succinctly (“India, radio button not checked”), providing both clarity and brevity.

JAWS announcement:

JAWS speech history: group start, where do you live, India radio button not checked, 1 of 3, Germany radio button checked, 2 of 3, Spain radio button not checked, 3 of 3, group end where do you live

NVDA announcement:

NVDA speech viewer:grouping, where do you live, radio button not checked India, radio button checked Germany, radio button not checked Spain"

Scenario #5: <button> Element with role="combobox" and Inner Text

A combo box is an input widget that allows users to choose a value from an associated popup, typically defined using the <select> and <option> elements. However, when the popup is a custom dialog—such as a date picker or color selector—developers sometimes create it using a <button> element with role="combobox".

This approach can be acceptable, but it fundamentally changes the element’s semantic role. Once a native <button> is assigned role="combobox", assistive technologies no longer treat it as a button but as a combo box. Therefore, developers must ensure that the custom widget fully supports combo box behavior, including:

  • Proper keyboard interaction patterns
  • Correct use of attributes such as aria-expanded and aria-controls

If these behaviors are not correctly implemented, the control may fail Success Criterion 4.1.2 (Name, Role, Value) because the widget does not expose its role, state, and value properly to assistive technologies.

 

Example: A <button> element with role="combobox" that opens a date picker dialog.

<button role="combobox" aria-haspopup="dialog">Date of birth</button>

It would look like this:

Dialog with text "Date of Birth" and dropdown arrow

Visually, this looks fine. It appears as a button labeled “Date of birth,” which opens a date picker dialog when activated. You might assume that the visible text “Date of birth” will act as the accessible name, just as it does for a regular <button>.

But that’s not what happens.

When a <button> has role="combobox", the inner text is no longer treated as the accessible name. Instead, it is treated as the current value of the combo box. This is because role="combobox" switches the element into a widget role where inner text represents user-selected content, not a label. As a result, the element lacks an accessible name altogether, even though screen readers may still appear to announce “Date of birth.”

Screenshot of computed properties for Date of Birth dialog showing no accessible name

In this situation, screen readers typically announce:

“Combobox Date of birth opens dialog.”

Here, “Date of birth” sounds like the accessible name, but technically, it’s being interpreted as the combo box’s value, not its programmatic label.

 

To ensure that the combobox has a valid accessible name, explicitly define one using either aria-label or aria-labelledby.

<span id="dob"> Date of birth </span>
<button role="combobox" aria-haspopup="dialog" aria-labelledby="dob">06-June-2000</button>

Date of birth dialog box showing 6 June 2000 selected

Now, assistive technologies will correctly announce:

“Date of birth, combobox, 06-June-2000, opens dialog.”

In this corrected example:

  • The accessible name (“Date of birth”) comes from the <span> referenced by aria-labelledby.
  • The current value (“06-June-2000”) is represented by the inner text of the <button>.

The Accessibility Tree now shows the computed accessible name.

Screenshot of computed properties for Date of Birth dialog showing accessible name

Note: It’s important to note that behaviors such as how the title or placeholder attributes are announced can vary significantly across screen readers and browsers. To ensure consistent accessibility, developers should test with multiple combinations, including:

  • NVDA + Firefox
  • JAWS + Chrome or Edge
  • VoiceOver + Safari

Testing across these environments helps verify that accessible names, roles, and values are exposed as expected for all users.

Conclusion

Creating accessible names and labels is more than just adding text next to a control — it’s about ensuring that every user, including those relying on assistive technologies, can understand and interact with your interface effortlessly. A well-structured naming strategy not only improves accessibility but also enhances usability for everyone.

Here are a few key takeaways to keep in mind:

  • ✅ Use <label> elements for visible and programmatic names whenever possible.
  • ✅ Use aria-labelledby to associate a visible label that exists elsewhere in the DOM.
  • ✅ Use aria-label only when no visible label is available.
  • ❌ Don’t rely solely on placeholder or title for labeling form controls.
  • ❌ Don’t use empty <label> elements or empty <option> elements, as they result in missing or unclear accessible names.

By following these practices, you’ll help ensure that your web interfaces communicate effectively with all users, regardless of how they access them.

Resources

 

Like to be notified about more articles like this? Subscribe to the Knowledge Center Newsletter. It not only gives you summaries and links to our technical blog posts but also TPGi webinars, podcasts, and business blog posts – as well as accessibility and web tech conferences and other events, and a reading list of other relevant articles. You get one email a month, it’s free, requires just your email address, and we promise we won’t share that with anyone. Check the archive.

The post Accessible Names and Labels: Understanding What Works and What Doesn’t appeared first on TPGi — a Vispero company.

Weekly Reading List November 10 2025

10 novembre 2025 à 13:59

The post Weekly Reading List November 10 2025 appeared first on TPGi — a Vispero company.

Link vs Button: Choosing the Right Element for the Right Job

10 novembre 2025 à 11:49

When it comes to building accessible and user-friendly interfaces, one of the most overlooked distinctions in web development is between links and buttons. They may look similar visually and even behave similarly when styled with CSS or enhanced with JavaScript, but their semantics and purposes are fundamentally different, and these differences matter greatly for accessibility.

Understanding the Difference

While the Web Content Accessibility Guidelines (WCAG) do not explicitly prohibit misusing link or button semantics if functionality and accessibility outcomes are preserved, best practice — supported by W3C and Authoring Practices — is to use the correct semantic element for each purpose. Semantics convey meaning — not just to developers, but also to assistive technologies like screen readers.

Here are the main distinguishing factors between the two:

  • Links (<a> elements) take users to different locations — either to another page or a different section of the same page.

    Example: Navigating to a “Contact Us” page or jumping to a specific heading on the current page.

  • Buttons (<button> elements) activate an action or functionality, typically on the same page.

    Example: Expanding a hidden menu, submitting a form, toggling a theme, or opening a modal dialog.

While there are gray areas, such as a control that loads new content dynamically without a full page reload, the distinction usually comes down to navigation vs. action.

Why the Difference Matters for Screen Reader Users

Screen readers inform users whether something is a link or a button. When a screen reader encounters these elements, it announces their role — saying “link” or “button” before the accessible name.

For example:

  • A screen reader might announce “Link, Home.”
  • Or “Button, Submit Form.”

This helps users understand what to expect when they interact with the element. However, when developers blur the lines — such as making a link act like a button with JavaScript — it can lead to serious confusion.

Imagine a user looking for a specific link in the “List of Links” feature available in most screen readers. If that “link” was coded as a <button> instead, it won’t appear in the list at all, leaving the user unable to find it. Likewise, if a button is incorrectly coded as a link, it may appear in the wrong context.

This kind of semantic mismatch can frustrate screen reader users and create unnecessary accessibility barriers.

Designing Accessible Links

A well-designed link is both descriptive and distinctive. Let’s look at what that means in practice.

How to Define a Link

Use the <a> element (or role="link" with other elements) for navigation between different pages or sections. It must include an href attribute. Without the href attribute, an <a> element is not keyboard-focusable or recognized as a link by assistive technologies.”

Example:

<a href="/about">About Us</a>

Make Links Descriptive and Contextually Clear

Clear and descriptive link text is one of the most important aspects of creating an accessible and user-friendly experience. A link should give users enough information to understand where it leads or what action it performs.

Where possible, provide a more descriptive visible link phrase for all users. Alternatively, you can use the following techniques to make them descriptive for screen reader users.

Wrapping the link with the surrounding text

Wrap the link and surrounding contextual information within a same sentence, paragraph, list item, table cell, or associated table headers that gives meaning to the link in context.

Example: Adding Context Using a Paragraph

<p>Our new accessibility testing tool integrates seamlessly with CI/CD pipelines. <a href="/blog/new-accessibility-tool">Read more</a> about the new tool.</p>

In this approach, if a screen reader user navigates by links alone, they will still understand what the “Read more” link refers to.

Using Visually Hidden Text

When the visual design limits space, you can add hidden text to make link text more specific without affecting the visible layout.

Example: “Learn More” Link with Hidden Context

<a href="/services/web-accessibility"> Learn more<span class="visually-hidden"> about our web accessibility services</span></a>.
<----- CSS Starts ------>
.visually-hidden {
clip-path: inset (50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}
<----- CSS Ends ------>

In this example, sighted users see “Learn more,” while screen reader users hear “Learn more about our web accessibility services.”

Using aria-label to override native link text

If adding visually hidden text isn’t possible, the aria-label attribute can also be used to add context.

Example:

<a href="/services/web-accessibility" aria-label="Learn more about our web accessibility services">Learn more</a>.

Note: The visible link phrase (in the example above “Learn more”) must be present in the aria-label, otherwise this would fail SC 2.5.3 Label in Name. For more information, please refer to How to meet SC 2.5.3 Label in Name.

Accessible Image Links

When an image is the only content inside a link, the alternative text (such as an alt attribute for an <img> element) becomes the accessible name of that link. It should clearly communicate the link’s purpose or destination.

Example:

<a href="https://www.tpgi.com/"><img src="tpgi-logo.png" alt="TPGi home page"></a>

Here, the alt text “TPGi home page” describes the target of the link.

Note: If the logo itself contains text, such as “TPGi,” the alt text should include it to satisfy SC 2.5.3 Label in Name.

Using aria-describedby for supplementary descriptions

In some cases, you may want to provide additional descriptive context for a link, for example, to clarify the destination or potential actions when multiple links are present with the same accessible name. You can use aria-describedby to associate the link with descriptive text elsewhere on the page.

Example:

<p id="policy-desc">This document explains our approach to protecting your personal data.</p>
<p><a href="/privacy-policy" aria-describedby="policy-desc">View Privacy Policy</a><p>

In this example, screen reader users will hear:

“View Privacy Policy — This document explains our approach to protecting your personal data.”

Using the title attribute (as a last resort)

The title attribute can be used to provide extra information about a link. However, it should be treated as a last resort because:

Example:

<a href="/team" title="Meet the TPGi accessibility team">Our Team</a>

Note: Some screen readers may not consistently announce the title attribute. In addition, many users, especially those using touch devices or voice access tools, cannot access title tooltips, making this method unreliable for conveying essential information.

Indicating New Windows or Tabs

If a link opens in a new tab or window, this must be indicated, both visually and programmatically.

Example:

<a href="https://example.com" target="_blank" rel="noopener">Visit Example.com (opens in a new tab)</a>

Users of assistive technologies must not be surprised by a change in context. Announcing it clearly avoids confusion and maintains a sense of control.

Visual Distinction

Links should be visually distinguishable from surrounding text — typically by color and/or underline. Relying only on color differences can pose challenges for users with color vision deficiencies, so consider underlines or other visual cues.

Designing Accessible Buttons

Buttons are about actions, not destinations. They trigger behavior on the same page, such as submitting data, opening menus, or changing states.

How to Define a Button

Use the <button> element (or role="button" with all the other elements) for any control that performs an action.

Note: ARIA should not be used to repurpose native elements when native semantics suffice. For example, role="button" on a <div> is acceptable only if no suitable HTML element can serve the purpose.

<button type="submit">Submit Form</button>

Note: Avoid using <div> or <span> with click handlers to mimic button behavior, doing so removes the inherent keyboard accessibility and role information that come built into <button>, unless absolutely necessary and fully ARIA-enabled.

Descriptive Button Labels

The button’s accessible name should clearly describe its action. Avoid generic terms like “Go” or “OK” when the context isn’t obvious.

Similar to links, buttons can also use aria-label, aria-describedby, title, or an inner image element with proper alt text to convey descriptive meaning.

Example: Button with aria-label

<button type="button" aria-label="Search the website">
  <svg aria-hidden="true" viewBox="0 0 24 24">
  <path d="..." />
  </svg>
</button>

Here, the icon alone wouldn’t communicate meaning to screen reader users, so the aria-label provides an accessible name (“Search the website”).

Example: Button with aria-describedby

<p id="save-desc">Saves your draft progress without submitting.</p>
  <button type="button" aria-describedby="save-desc">Save Draft</button>

This technique is helpful when additional context is needed, for example, to clarify what the button does.

Example: Button with title (use sparingly)

<button type="button" title="Download report as PDF">Download</button>

Note: The title attribute should be used only as supplementary information. It is not consistently announced by all screen readers and may not be accessible on touch devices.

Example: Button with an inner image element

<button type="button">
  <img src="download-icon.png" alt="Download report">
</button>

If an image represents the button’s purpose, its alt text must clearly describe the action (e.g., “Download report”).

Why It’s a Best Practice, Not a WCAG Failure

Misusing a link or a button is not directly a WCAG failure, but it’s considered a best practice issue that significantly affects usability and consistency.

Here’s why:

  • WCAG focuses on accessibility outcomes, such as ensuring that elements are operable, perceivable, understandable and robustness.
    A link coded as a button might still be technically accessible if it can be operated by keyboard and announced properly by assistive technologies.
  • However, using incorrect semantics can confuse users and break expected navigation patterns. For instance:
    • Screen reader users expect links to appear in the “links list” and buttons to appear in the “buttons list.”
    • Keyboard users expect links to be activated with the Enter key and buttons with the Spacebar or Enter keys.

When these expectations are broken, even if the control remains technically functional, it reduces the predictability and usability of the interface.

Thus, it’s considered an accessibility best practice, not a violation.

Correct semantics improve the user experience, enhance clarity for assistive technologies, and align with the principles of SC 3.2.4 (Consistent Identification) and SC 4.1.2 (Name, Role, Value), which emphasize predictable and consistent interactions.

The built-in keyboard operability of semantic <button> and <a> elements also ensures conformance with SC 2.1.1 Keyboard. By distinguishing links from buttons correctly, you help users navigate confidently and build more inclusive experiences.

Following this best practice makes your content more robust, consistent, and user-centered, which are all foundational pillars of accessibility.

Resources

Like to be notified about more articles like this? Subscribe to the Knowledge Center Newsletter. It not only gives you summaries and links to our technical blog posts but also TPGi webinars, podcasts, and business blog posts – as well as accessibility and web tech conferences and other events, and a reading list of other relevant articles. You get one email a month, it’s free, requires just your email address, and we promise we won’t share that with anyone. Check the archive.

The post Link vs Button: Choosing the Right Element for the Right Job appeared first on TPGi — a Vispero company.

The State of Accessibility – Episode 14

5 novembre 2025 à 20:35

November 2025 — Mobile Accessibility

Video not playing? Watch it on YouTube.

Read the transcript.

Listen to the podcast on Spotify or Podbean.

Have you ever wondered about mobile app accessibility? In our next episode, host David Sloan, Chief Accessibility Officer, and guest John Lilly, Principal Accessibility Engineer, will discuss how you can create more accessible mobile app user experiences and start creating more inclusive digital experiences for all.

Join us live on our LinkedIn on November 12 at 10:30 AM EST.

The post The State of Accessibility – Episode 14 appeared first on TPGi — a Vispero company.

Weekly Reading List November 3 2025

3 novembre 2025 à 13:24

The post Weekly Reading List November 3 2025 appeared first on TPGi — a Vispero company.

Weekly Reading List October 27 2025

27 octobre 2025 à 13:26
Weekly Reading List

The post Weekly Reading List October 27 2025 appeared first on TPGi — a Vispero company.

Weekly Reading List October 20 2025

20 octobre 2025 à 15:02
Weekly Reading List

The post Weekly Reading List October 20 2025 appeared first on TPGi — a Vispero company.

What State ARIA In?

20 octobre 2025 à 14:15

Accessible Rich Internet Applications (ARIA) attributes play a vital role in communicating dynamic interface states to assistive technologies. However, attributes like aria-selected, aria-pressed, aria-current, and aria-checked are often confused because they all express some form of “state” or “selection.”

In this article, we’ll clarify what each of these attributes does, when to use them, and common mistakes developers make, helping ensure your ARIA implementation accurately reflects the user interface state and supports a predictable experience for assistive technology users.

aria-selected – Represents an Item’s Selection Within a Set

aria-selected is used for elements within a group of options where one or more items can be selected by the user. It tells assistive technology which item is currently chosen.

Typical use cases:

  • Tabs within a tablist (role="tab")
  • Listbox options (role="option")
  • Rows or cells in a grid (role="row" or role="gridcell")
  • Items within a hierarchical tree structure (role="treeitem")

Example:

<div role="tablist" aria-label="Sample Tabs">
  <button role="tab" aria-selected="true" aria-controls="panel1" id="tab1">Overview</button>
  <button role="tab" aria-selected="false" aria-controls="panel2" id="tab2">Details</button>
  <button role="tab" aria-selected="false" aria-controls="panel3" id="tab3">Settings</button> 
</div> 
<div id="panel1" role="tabpanel" aria-labelledby="tab1">Overview content...</div> 
<div id="panel2" role="tabpanel" aria-labelledby="tab2" hidden>Details content...</div> 
<div id="panel3" role="tabpanel" aria-labelledby="tab3" hidden>Settings content...</div> 

Key takeaway

Use aria-selected only when items belong to a selectable group. It does not toggle a control; it simply communicates which item is selected.

Developers sometimes confuse aria-selected with aria-current. While aria-selected indicates what a user has actively chosen within a group, aria-current indicates the user’s current context, such as the active page or the current step in a process.

Note: aria-selected applies only to roles that support selection — not arbitrary elements — and that using it on unsupported roles has no effect.

aria-pressed – Indicates a Toggle Button’s State

aria-pressed is applied to elements with role="button" that behave like switches or toggles. It describes whether the button is currently active (pressed) or inactive (not pressed).

Possible values:

  • true – Button is pressed/active
  • false – Button is not pressed/inactive
  • mixed – Button has a partially active state (e.g., “select all” that’s partially selected)

Example:

<button aria-pressed="true">Bold</button> <button aria-pressed="false">Italic</button> 

Key takeaway

Think of aria-pressed as representing an on/off or active/inactive state, not selection within a group.

Note: The aria-pressed="mixed" state has limited support in native elements and should be reserved for advanced composite toggle patterns, such as “Select All That Apply” interfaces, where the active state represents a partial selection across a group of interrelated controls.

aria-checked – Used for Checkable Widgets

aria-checked indicates whether a checkable element (such as a checkbox, radio button, menu item, or switch) is checked, unchecked, or mixed.

Possible values:

  • true – Checked
  • false – Unchecked
  • mixed – Indeterminate (e.g., “partially selected” parent node)

Example:

<div role="checkbox" aria-checked="true">Select All Notifications</div> 

Key takeaway

Use aria-checked only for widgets where users explicitly check or uncheck items. For elements with role="switch", only true or false are valid values; mixed should not be used. The aria-checked="mixed" state is invalid for the switch role in the current ARIA specification, and user agents must treat a mixed value as equivalent to false for this role.

aria-current – Identifies the Current Item or Location

aria-current marks an item that represents the current point of reference within a set, such as the active page, date, or step. It doesn’t indicate user action but rather context or position.

Common values:

  • page – Current page (recommended for navigation links)
  • step – Current step in a process
  • date – Current date
  • true – Generic “current” state (fallback when a more specific value doesn’t apply)
  • false – Explicitly marks an item as not current (optional; omitting aria-current usually has the same effect)

Example:

<nav aria-label="Main navigation"> 
  <a href="/home" aria-current="page">Home</a> <a href="/about">About</a> <a href="/contact">Contact</a> </nav>

Key takeaway

aria-current identifies where the user is, not what they have selected. It provides important contextual cues, particularly in navigation menus and step indicators.

Summary: Key Differences

Comparison of ARIA State Attributes

Attribute Purpose Common Roles Values Best Used For
aria-selected Marks an item as selected within a group tab, option, row, gridcell, treeitem true / false Highlighting selected item in a set (e.g., tabs, listbox, tree)
aria-pressed Indicates a toggle button’s active state button true / false / mixed* Toggle buttons (e.g., Bold/Italic). Mixed is for advanced composite toggles like “Select All That Apply”
aria-checked Shows checked/unchecked/mixed state checkbox, radio, menuitemcheckbox, switch true / false / mixed** Checkable controls. For role=”switch”, only true/false are valid; mixed is invalid
aria-current Identifies current location or context link, listitem, step, date page / step / date / true / false Current page, step, date, or contextual item.

* Limited support for mixed in native buttons; intended for complex composite toggle patterns.
** mixed is valid for checkboxes / radio / menuitemcheckbox, but not for switch; user agents treat mixed as false for switch.

Common Mistakes Developers Make

Even experienced developers sometimes mix up these attributes. Here are a few frequent issues:

Using aria-selected on navigation links

Developers often mark the current page link with aria-selected=”true”.
✅ Correct approach: Use aria-current="page" instead.

Using aria-checked for toggle buttons

Toggle buttons should use aria-pressed, not aria-checked.
✅ Example: <button aria-pressed="true">Mute</button>

Forgetting to update the ARIA state dynamically

When a button or checkbox changes visually, its ARIA state must also update programmatically to reflect that change.
✅ Keep ARIA states synchronized with UI behavior.

Applying multiple ARIA state attributes together

Adding both aria-selected and aria-pressed to the same element can confuse assistive technologies.
✅ Use only the one that matches the widget’s interaction pattern.

Overusing ARIA on native HTML controls

Native controls already communicate state through built-in accessibility APIs. Adding redundant ARIA attributes can cause duplicate or conflicting announcements.
✅ Prefer semantic HTML elements wherever possible.

Not removing unused ARIA attributes

When a widget changes state or is hidden/removed, leftover ARIA attributes can cause assistive technologies to announce outdated information.
✅ Tip: Always remove or update ARIA attributes when no longer relevant to prevent confusion and ensure accurate accessibility feedback.

Why This Matters

Correct ARIA state usage ensures that assistive technologies, such as screen readers, convey accurate and predictable information to users. Misusing these attributes can result in misleading or inconsistent feedback. for example, announcing a toggle button as a checkbox or marking a link as “selected” instead of “current.”

By aligning your implementation with the WAI-ARIA Authoring Practices 1.2, you ensure that your components behave consistently across devices and assistive technologies.

Best Practices

  • ✅ Use native HTML elements whenever possible; they include built-in ARIA semantics.
  • ✅ Dynamically update ARIA states as user interactions occur.
  • ⚠ Avoid redundant or conflicting ARIA attributes.
  • ⚠ Always test using screen readers (NVDA, JAWS, VoiceOver, TalkBack) to confirm correct behavior.
  • ⚙ Follow WAI-ARIA Authoring Practices 1.2 for implementation examples.

Conclusion

Each ARIA state attribute serves a distinct purpose:

  • Use aria-selected to indicate selected items within a group.
  • Use aria-pressed for toggle buttons representing on/off or active/inactive states.
  • Use aria-checked for checkable controls such as checkboxes or radios.
  • Use aria-current to identify the user’s current location or context.

Correct use of these attributes ensures assistive technologies present information accurately, fostering predictable and inclusive interactions.

By applying ARIA semantics carefully and only where necessary, developers can create interfaces that are not just compliant but truly accessible for all users.

Resources

  1. MDN – ARIA: aria-selected attribute
  2. MDN – ARIA: aria-pressed attribute
  3. MDN – ARIA: aria-current attribute
  4. MDN – ARIA: aria-checked attribute
  5. Accessible Rich Internet Applications (WAI-ARIA) 1.2
  6. ARIA Authoring Practices Guide (APG)
Like to be notified about more articles like this? Subscribe to the Knowledge Center Newsletter. It not only gives you summaries and links to our technical blog posts but also TPGi webinars, podcasts, and business blog posts – as well as accessibility and web tech conferences and other events, and a reading list of other relevant articles. You get one email a month, it’s free, requires just your email address, and we promise we won’t share that with anyone. Check the archive.

The post What State ARIA In? appeared first on TPGi — a Vispero company.

Weekly Reading List October 13 2025

13 octobre 2025 à 14:44

Weekly Reading List

The post Weekly Reading List October 13 2025 appeared first on TPGi — a Vispero company.

Tables: Beyond Rows and Columns

13 octobre 2025 à 14:33

There are many semantic HTML tags covered under WCAG SC 1.3.1: Info and Relationships, but in this article, we’ll zoom in on one of the most misunderstood, the table.

You might be thinking: “Do we really need tables when we already have semantic tags like lists?”

It’s a valid question. Lists (<ul>, <ol>, <dl>) are fantastic for presenting structured information, but when data grows beyond a simple one-to-one relationship, tables step in as the powerhouse.

Lists vs. Tables: When Does a Table Make Sense?

Imagine you want to display personal details. Using a description list, the information looks clean and simple:

<h2>Personal Details</h2>
  <dl>
  <dt>Full Name</dt>
  <dd>Tom Henry</dd>
  <dt>Date of Birth</dt>
  <dd>01-Jan-1999</dd>
  <dt>Gender</dt>
  <dd>Male</dd>
  <dt>Country</dt>
  <dd>Australia </dd>
  <dt>Company</dt>
  <dd>Google</dd>
</dl>

It would look like this:

Description list shwoing the data described in the markup

That’s great for a single person’s data. But what if you have multiple people’s details?

A list would stretch the page endlessly, making it harder for users (especially screen reader users) to locate specific information. This is where a table becomes the clear winner:

<table>
  <thead>
<tr>
    <th>Full Name</th>
    <th>Date of Birth</th>
    <th>Gender</th>
    <th>Country</th>
    <th>Company</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>Tom Henry</td>
    <td>01-Jan-1999</td>
    <td>Male</td>
    <td>Australia</td>
    <td>Google</td>
  </tr>
  <tr>
    <td>Stifen Watson</td>
    <td>02-Jan-2000</td>
    <td>Male</td>
    <td>U.S.</td>
    <td>TPGi</td>
  </tr>
</tbody>
</table>

This will look like:

The data described in the markup shown as table with rows and columns.

Now, the same information is organized in rows and columns. Users can scan by column (e.g., find all employees from India) or by row (see all details of one person) in an instant.

Defining the Data Table

A well-structured table is more than just rows and cells. For screen readers and other assistive technologies, the right markup tells the story:

The data table’s semantic structure is already explained in the Tables Tutorial | Web Accessibility Initiative (WAI) | W3C. but just to be on the same page, here’s the basic concept of defining a data table:

  • <table> defines the table
  • <tr> defines each row.
  • <td> holds the data.
  • <th> indicates headers. Column headers are defined together as a row of <th> elements, while row headers are defined as a single <th> within each row of <td>.

This semantic structure allows assistive technologies to announce relationships like: “Date of Birth, 01-01-2000.” Instead of just reading “01-01-2000” without context.

Labeling the Table

When there’s only one table on a page, users usually know what it represents. But if you have multiple tables, things get tricky.

For example, screen reader might announce both tables simply as: “Table with 3 rows and 5 columns.”

JAWS speech viewer screenshot:

JAWS speech viewer describing two tables with the same apparent data.

NVDA speech viewer screenshot:

NVDA speech viewer describing two tables with the same apparent data.

Confusing, right?

That’s why naming tables is important. You can do this using the <caption> element:

<table>
    <caption>2025 Employees Details</caption>
    ...
</table>

<table>
    <caption>2024 Employees Details</caption>
    ...
</table>

JAWS announcement:

  • “table with 5 columns and 3 rows 2025 Employees Details, Column 1, Row 1” for the first table.
  • “table with 5 columns and 3 rows 2024 Employees Details, Column 1, Row 1” for the second table.

JAWS speech viewer describing two tables with the same apparent data but identified by different captions.

NVDA announcement:

  • “2025 Employees Details table with 3 rows and 5 columns” for the first table.
  • “2024 Employees Details table with 3 rows and 5 columns” for the second table.

NVDA speech viewer describing two tables with the same apparent data but identified by different captions.

Problem solved! Users now know exactly what each table represents.

Alternatively, aria-label or aria-labelledby can also be used to define the label for the table.

<table aria-label=”2024 Employees Details”>
    ...
</table>
Note: Defining a caption or a name is not required by WCAG. If you skip it, it’s not considered a failure. However, it is recommended as a best practice, specifically when more than one table is present.

If a table is complex or requires extra explanation, you can add an aria-describedby attribute to provide a short description. This helps screen reader users understand the table’s purpose and structure before navigating through its data.

<p id="tableDesc">
  This table provides employee details, including department, role, and seminar participation status for 2024.
</p>
<table aria-describedby="tableDesc">
...
</table>

JAWS announcement:

“Table with 4 columns and 2 rows. This table provides employee details, including department, role, and seminar participation status for 2024. Column l, Row 1 Employee Name”

JAWS speech viewer describing a table, including the table description.

NVDA announcement:

“Table with 2 rows and 4 columns This table provides employee details, including department, role, and seminar participation status for 2024.”

NVDA speech viewer describing a table, including the table description.

Note: The older summary property served a similar purpose in earlier HTML versions, but it is now deprecated in HTML5. While some assistive technologies may still recognize it, it’s best practice to use aria-describedby for long-term compatibility.

Layout table

A layout table is a table used purely for visual arrangement of content rather than for presenting data. In layout tables, there is no meaningful relationship between cells, and the table is only used for decorative or structural purposes.

Layout tables are acceptable in WCAG and can be used to arrange page elements such as headers, sidebars, and footers. However, this approach works visually, but it introduces accessibility challenges. Screen readers and other assistive technologies interpret tables semantically — announcing rows, columns, and headers — which can confuse users when no real data relationship exists.

For this reason, table markup should not be used for page design or visual layout.

What Not to Use in Layout Tables

Assistive technologies depend on table elements like <th> and <caption> to announce structure and meaning. Including these in layout tables misleads users by suggesting relationships that don’t actually exist.

For layout tables, avoid:

  • headers attribute
  • scope attribute
  • summary attribute
  • <th> element
  • <caption> element

Although WCAG does not prohibit the use of layout tables, CSS-based layouts are strongly recommended to preserve the proper semantic meaning of HTML table elements. When a table is used purely for layout, the <th> element, headers attribute, and scope attribute should not be used, since there is no actual relationship between data cells.

Likewise, the <caption> element and summary attribute should not be used, as they are intended to provide descriptions for data tables, not layout structures.


<table>
<tbody>
  <tr>
    <td colspan="2" >
      <h1>Header Area</h1>
    </td>
  </tr>
  <tr>
    <td>
      <p>Sidebar content goes here. <br>Links or navigation. </p>
    </td>
    <td>
      <p>Main page content goes here. <br>This is where the main article, text, or image would be placed. </p>
    </td>
  </tr>
</tbody>
</table>

When read by a screen reader, this table is treated as layout-only, and table structure is ignored.

Screen reader announces:

“heading level 1 Header Area. Sidebar content goes here. Links or navigation. Main page content goes here. This is where the main article, text, or image would be placed.”

JAWS speech screenshot:

JAWS speech viewer describing the text content of a table

NVDA speech screenshot:

NVDA speech viewer describing the text content of a table

Identifying Layout Tables

If your markup is long and complex, the easiest way to confirm whether a table is being treated as a layout table is to inspect the accessibility tree. In such cases, you’ll see the table identified as a “LayoutTable” rather than a semantic data table.

Accessibility Tree showing LayoutTable as a sub-branch of RootWebArea

Making Layout Tables Invisible to Assistive Tech

Alternatively, role="presentation" or role="none" can be applied to remove the semantic meaning of a table from the accessibility API, even if elements like <table> or <th> are present.

<table role=”presentation”>
 ...
</table>

With this approach, the entire table structure is ignored in the accessibility tree, and only the actual content inside the table is exposed to assistive technologies.

Accessibility Tree showing LayoutTable sub-branch of RootWebArea replaced by Ignored

Making Tables Responsive While Preserving Accessibility

Tables often contain large amounts of data, which can make them difficult to view on smaller screens. While many developers try to make tables “fit” by hiding columns or reflowing them into lists, these approaches can break relationships between data cells and headers.

A simple and effective way to handle this is to make the table scrollable horizontally.

<div style="overflow-x: auto;">
  <table>
    ...
  </table>
</div>

Table too wide for viewport shown with horizontal scrollbar

The overflow-x: auto; property allows users to scroll horizontally when the table width exceeds the viewport.

Conclusion

In my opinion, tables are one of the most powerful semantic tools in HTML, but they’re also among the most misunderstood. While lists and other tags can handle simple cases, tables shine when it comes to organizing and presenting complex datasets. A well-structured table does more than group information—it creates meaningful relationships between data and headers, making content more accessible for everyone, especially users of assistive technologies.

At the same time, tables should never be misused for layout purposes. Layout tables may still “work” visually, but can introduce barriers when screen readers announce them as data. By choosing semantic HTML elements appropriately and relying on CSS for layout, developers can create content that is both visually appealing and accessible to all users.

Resources

Like to be notified about more articles like this? Subscribe to the Knowledge Center Newsletter. It not only gives you summaries and links to our technical blog posts but also TPGi webinars, podcasts, and business blog posts – as well as accessibility and web tech conferences and other events, and a reading list of other relevant articles. You get one email a month, it’s free, requires just your email address, and we promise we won’t share that with anyone. Check the archive.

The post Tables: Beyond Rows and Columns appeared first on TPGi — a Vispero company.

Weekly Reading List October 6 2025

6 octobre 2025 à 14:47

Weekly Reading List

The post Weekly Reading List October 6 2025 appeared first on TPGi — a Vispero company.

Understanding the Removal of 4.1.1 Parsing in WCAG 2.2

1 octobre 2025 à 14:47

For anyone developing accessible digital content, keeping up with changes to the Web Content Accessibility Guidelines (WCAG) is essential. One of the more notable updates in WCAG 2.2 is the removal of Success Criterion (SC) 4.1.1: Parsing.

This article explains what SC 4.1.1 covered, why it was removed, how it affects accessibility in practice, and which criteria now address issues once covered by parsing.

Why Does It Matter?

Parsing errors, such as invalid or poorly structured markup, were once a significant concern because they could affect how assistive technologies interpreted a webpage. Earlier, assistive technologies sometimes performed their own parsing, which made them more vulnerable to broken markup. Since WCAG 2.0 was published, however, both web specifications (such as HTML) and browsers have greatly improved in handling these errors.

Today, assistive technologies rely on the browser’s interpretation of markup rather than doing their own parsing. Because of this, most parsing errors no longer create real barriers for users, which is why SC 4.1.1 was made obsolete in WCAG 2.2.

SC 4.1.1 was originally included to encourage valid, well-structured markup. Its removal does not mean that writing clean code is unimportant; rather, it acknowledges that this requirement is no longer necessary because modern browsers and assistive technologies handle parsing errors far more reliably.

What Was 4.1.1 Parsing?

Under WCAG 2.1, SC 4.1.1 required:

  • HTML, XML, or other markup languages to follow syntax rules.
  • Proper nesting and closing of elements.
  • Unique ID attributes for all elements.
  • Avoidance of stray or unclosed tags that could disrupt the document structure.

The aim was to ensure that assistive technologies and browsers could interpret content reliably, improving both accessibility and interoperability.

What Changed in WCAG 2.2?

WCAG 2.2 removed SC 4.1.1 for several reasons:

  1. Limited Direct Impact

    Many parsing issues no longer create real barriers for assistive technology users.

    Example:

    <div>
      <p>Hello, world
    <--missing </div> and </p> -->

    This markup triggers a validator error, but browsers typically auto-correct it, and therefore assistive technologies will interpret it correctly.

  2. Relevance Under Other Criteria

    Real-world issues tied to invalid markup are better addressed under other criteria:

    • Duplicate ID values → SC 4.1.2: Name, Role, Value
    • Incorrect nesting of interactive elements → SC 2.4.3: Focus Order, SC 4.1.2: Name, Role, Value
    • Stray or unclosed tags → SC 1.3.1: Info and Relationships, SC 4.1.2: Name, Role, Value
  3. Technology Evolution

    When SC 4.1.1 was introduced, browsers and assistive tech often broke on stray tags or invalid nesting. Today, both are far better at handling minor syntax errors, so these issues rarely block access.

  4. Focus and Simplicity

    Removing SC 4.1.1 helps WCAG focus on accessibility issues that affect users directly, instead of minor coding mistakes that don’t cause real problems.

What Are the Risks Now?

Although most parsing errors no longer block accessibility, some mistakes can still cause real problems when they affect element relationships, accessible names, roles, or focus order. These issues are now handled under other Success Criteria rather than SC 4.1.1.

Duplicate ID values

Every id attribute in a document is required to be unique. Problems caused by duplicates depend on context:

  • A <label for="id"> may associate with the wrong input, causing screen readers to announce incorrect or confusing information.
  • ARIA references such as aria-labelledby, aria-controls, or aria-describedby may fail, breaking the link between elements and leaving users without instructions.
  • Links pointing to an id may direct users to the wrong location or confuse screen reader navigation.

Relevant SCs: 1.3.1 Info and Relationships, 1.3.2 Meaningful Sequence, 2.4.3 Focus Order, 2.4.4 Link Purpose, 4.1.2 Name, Role, Value, 2.5.3 Label in Name

Improper nesting of interactive elements

Interactive elements (like <a>, <button>, <input>, <select>) should not be nested inside one another.

Example:

<a href="#"&gt:
  <button>Click Me</button>
</a&gt>

Risks include:

  • Confusing the accessibility tree, making it unclear which element should receive focus.
  • Inconsistent behavior across browsers and assistive technologies.
  • Keyboard navigation issues, such as incorrect focus order or unexpected activation.

Relevant SCs: 2.4.3: Focus Order, 4.1.2: Name, Role, Value

Stray tags or unclosed elements

Errors like unclosed elements or misplaced tags generally do not block access today because modern browsers can handle them. However, issues arise when they disrupt:

  • Relationships between labels, controls, and interactive elements.
  • Heading order, table structures, or list order.
  • ARIA widget structure or scripted behavior dependent on the DOM.

Example:

<ul>
  <li>First item
  <li>Second item
</div> <!-- Stray closing div -->

Risks include:

  • Screen readers may skip content or read it in the wrong order.
  • CSS and JavaScript that rely on a predictable DOM structure may break.
  • Layout or structure may render inconsistently across browsers, making navigation harder for users with disabilities.

Relevant SCs: 1.3.1: Info and Relationships, 4.1.2: Name, Role, Value

Labels not programmatically associated

Example:

<label>First Name</label>
<input type="text" id="firstName">

Since there’s no for linking the label to the input, screen readers may not announce it when focus enters the field, confusing users relying on assistive technology or voice input.

Relevant SCs: 1.3.1: Info and Relationships, 4.1.2: Name, Role, Value

Best Practices Going Forward

To ensure accessible experiences under WCAG 2.2:

  • Write clean, semantic HTML – While no longer enforced by 4.1.1, well-formed markup improves consistency across platforms.
  • Match visible labels with accessible names – Essential for screen reader and voice control users.
  • Test keyboard navigation – Verify logical focus order, operable controls, and no traps.
  • Use semantic structure – Apply headings, ARIA landmarks, and labels to convey relationships clearly.

Conclusion

The removal of SC 4.1.1 from WCAG 2.2 marks a shift from syntax enforcement to user-centered accessibility. Clean code remains a best practice, but WCAG now emphasizes whether users with disabilities can access, perceive, and operate digital content.

Developers should continue to:

  • Write semantic, valid code.
  • Provide proper labeling.
  • Ensure robust keyboard support.
  • Maintain logical content structures.

By prioritizing real user experience over strict validator compliance, we can build more inclusive and usable digital environments.

References

Like to be notified about more articles like this? Subscribe to the Knowledge Center Newsletter. It not only gives you summaries and links to our technical blog posts but also TPGi webinars, podcasts, and business blog posts – as well as accessibility and web tech conferences and other events, and a reading list of other relevant articles. You get one email a month, it’s free, requires just your email address, and we promise we won’t share that with anyone. Check the archive.

The post Understanding the Removal of 4.1.1 Parsing in WCAG 2.2 appeared first on TPGi — a Vispero company.

Weekly Reading List September 29 2025

29 septembre 2025 à 15:18

Weekly Reading List

The post Weekly Reading List September 29 2025 appeared first on TPGi — a Vispero company.

Creating a truly accessible Flip Card

24 septembre 2025 à 15:04

This article describes an approach for creating accessible Flip Cards — small blocks of content designed to resemble a playing card or business card, or similar two-sided thing. They have front and back “faces” and can be “flipped” with a 3D rotation effect.

There are many existing scripts and libraries that implement this effect, but none I’ve found have good enough accessibility, and not for want of trying. Creating an accessible pattern for this was challenging.

Demos and codebase


The problem with flip cards

The front and back faces are separate blocks of content within a parent container, using transform and perspective to create the appearance of a two-sided card that turns on its vertical axis. This is quite easy to make, but quite hard to make accessible, because there aren't any ARIA semantics that fit the pattern.

Screen reader users need accessible state information, so they know when the card is flipped, and which side is currently shown. However we can't use ARIA state attributes to provide this information, simply because there aren't any valid choices. States like aria-expanded or aria-pressed are not applicable, because they don't mean the same thing — the card is never expanded or collapsed, never pressed or not pressed — the behavior and presentation just aren't equivalent.

The button that triggers the flip could be used to provide accessible feedback, by changing the button's label or description. However dynamically changing a button's content isn't conveyed by screen readers, unless it's also accompanied by a semantic state change … which we can't use!

ARIA live regions are not a suitable replacement here, because they're only appropriate for status updates, not state information.

Table of contents

An old-school solution

Without an ARIA state change, the most reliable way to make screen readers announce a button, is to programmatically focus() it. But in order to do that, the button first has to lose focus, yet we can't use blur() because that resets the focus position back to the top of the page, causing screen readers to re-announce the page summary (e.g., the title and main heading).

Focus has to go somewhere, and it has to go somewhere that won't be announced:

  1. An invisible element is positioned and sized directly behind the button;
  2. When the button is pressed, focus shifts to this invisible element, which isn't announced because it has no conveyable content;
  3. Meanwhile, the button's accessible label and description are updated;
  4. Then the button is focused again, and this triggers its re-announcement.

The button's label has values like Flip to back and Flip to front, which denote its current action. State information is provided by the accessible description, such as Now showing the front or Now showing the back. The label and description are both announced when the button is programmatically focused.

Overall, this combination of dynamic label and description provides a functional label, a dynamic state update, and a persistent state summary.

Table of contents


HTML

The content of each card face can be any valid HTML, there are no explicit requirements or restrictions. However the surrounding markup is very specific, and must have the following node structure and required attributes:

<div id="MyID" role="group" aria-labelledby="MyID_1">
    <aside hidden>
        <span id="MyID_1">Flip Card</span>
        <span id="MyID_2">Flip to front</span>
        <span id="MyID_3">Flip to back</span>
        <span id="MyID_4">Now showing the front</span>
        <span id="MyID_5">Now showing the back</span>
    </aside>
    <div>
        <button hidden aria-describedby="MyID_1"></button>
        <div>
            <!-- default content on the front face -->
        </div>
        <div>
            <!-- flipped content on the back face -->
        </div>
    </div>
</div>

Table of contents

Required elements and attributes

The <div>, <aside>, and <span> elements don't have to use those tags, any valid elements can be used. However their attributes must be as specified, and the button must be a <button>.

Group container
<div id="MyID" role="group" aria-labelledby="MyID_1">

The group container needs role="group" to provide a semantic context. The role doesn’t imply any other meaning or functionality, only that everything inside it is part of the same “thing”.

The aria-labelledby attribute defines the group’s accessible name, and must reference the id of the first language data element.

The group id is used in the demo as an identifier for the FlipCard constructor, and a syntactical namespace for other IDs.

Language data
<aside hidden>
    <span id="MyID_1">Flip Card</span>
    <span id="MyID_2">Flip to front</span>
    <span id="MyID_3">Flip to back</span>
    <span id="MyID_4">Now showing the front</span>
    <span id="MyID_5">Now showing the back</span>
</aside>

The language container must include the hidden attribute, which prevents it from being visibly rendered or present in the accessibility tree (equivalent to display:none in the user agent stylesheet, so it doesn’t rely on author CSS to remain hidden).

The five child elements define individual language strings. They must have id attributes, and they must be defined in the same order:

  1. Group name.
  2. Button label to flip the card to its front face.
  3. Button label to flip the card to its back face.
  4. Button description when the front face is displayed.
  5. Button description when the back face is displayed.

This content is not intended to be shown or directly announced, it only serves as reference data for aria-labelledby or aria-describedby, or to be parsed by the script in order to generate dynamic labels.

Card faces
<div>
    ...
    <div>
        <!-- default content on the front face -->
    </div>
    <div>
        <!-- flipped content on the back face -->
    </div>
</aside>

The parent container provides a positioning context, and defines the perspective size for 3D transforms:

{
    perspective: 64rem;
    position: relative;
}

The first face element is considered to be the front, and is displayed by default. The faces can contain any valid markup, including interactive elements, but it’s recommended to start each one with a heading (e.g., <h2> or <h3> as applicable to the page structure).

Flip button
<button hidden aria-describedby="MyID_1"></button>

The flip button’s hidden attribute is removed by the script, and exists only to hide the button when scripting is unavailable or hasn’t loaded yet.

The aria-describedby attribute must reference the id of the first language data element. This will be dynamically updated when the card state changes, however iOS/VoiceOver doesn’t support those dynamic description updates, therefore the static value is necessary to provide some fallback context for users, as to what the button’s action is referring to.

The button’s accessible name is also maintained by scripting, defined using aria-label, and rendered with CSS pseudo-content to provide a visible label:

button::before {
    content: attr(aria-label);
}

This approach provides more flexibility when styling the flip button, and since the values it’s derived from are already present as in-page text, there are no translation issues with using aria-label in this case.

Table of contents


CSS

The flip card has two static states — the front face is displayed, or the back face is displayed — and it flips between them by using transition to animate rotational transform on the faces' container.

This requires two separate transforms. If we only applied rotation to the container, then flipping from front to back would result in the back face being reversed (like a mirror image). But if we also apply rotation to the back face itself, then they cancel each other out by the end of the transition:

@media (prefers-reduced-motion: no-preference) {
    [data-flip-state] {
        perspective: 64rem;
    }
    [data-flip-state] > .faces {
        transform: rotateY(0deg);
        transition: transform 0.5s;
    }
    [data-flip-state~="flipped"] > .faces {
        transform: rotateY(180deg);
    }
    [data-flip-state] > .faces > .back {
        transform: rotateY(180deg);
    }
}

Most flip card implementations use absolute positioning and fixed dimensions, where the faces are stacked on top of each other and visibly rotate together. However that means the content can't be responsive to changes in font-size or text spacing, which might cause the layout to reflow and make one or both faces overflow the container.

This pattern does something different to avoid that problem — the two card faces are never displayed at the same time — so they don't need fixed dimensions or absolute positioning, they can freely adapt to reflow, and they don't even have to be the same size.

The trick here is that the displayed face changes in the middle of the transition (when rotation is 90°), which is not visually apparent because neither face is visible for that precise moment (like looking at the side of a playing card).

Table of contents

Styling hooks

The demo uses class names for each container element, but these are not required or even identified by the script, so you can do whatever you want:

<div class="card">
    ...
    <div class="faces">
        ...
        <div class="front">
            ...
        </div>
        <div class="back">
            ...
        </div>
    </div>
</div>

The script provides a dynamic [data-flip-state] attribute, which can be used as an attribute selector for state-dependent styling. For example, the following rule controls which face is currently displayed:

[data-flip-state~="front"] > .faces > .back,
[data-flip-state~="back"] > .faces > .front {
    display: none;
}

This attribute has four possible token values, and at any given moment it might have multiple tokens:

State attribute tokens
Token Meaning
"front"

The front face is currently displayed.

"back"

The back face is currently displayed.

"flipped"

The card is flipped to its back face.

"busy"

The card is currently transitioning between states.

Flipping from front to back will pass through the following states:

  1. "front"
  2. "front flipped busy"
  3. "back flipped busy"
  4. "back flipped"

Whereas flipping from back to front will do the reverse:

  1. "back flipped"
  2. "back busy"
  3. "front busy"
  4. "front"

Table of contents

Alternate button designs

The demo stylesheet uses pseudo-content to create a visible label from the button's aria-label attribute:

.faces > button::before {
    content: attr(aria-label);
}

This approach is recommended for the sake of accessible visual affordance — it clearly conveys the function to sighted users, and also provides a command cue for speech recognition. Users can press the button with a spoken command like Click flip to front (which still works without a visible label, but then how would they know what to say). However that provision is not absolutely critical, since users have other ways to reach and interact with controls (e.g., using the Show Numbers function in Voice Control for macOS and iOS).

One alternative presentation could be to use an icon, or an empty dot-like button:

.faces > button {
    border-radius: 1rem;
    height: 1rem;
    width: 1rem;
}
.faces > button::before {
    content: none;
}

Another possibility is to style the button so it's completely transparent and covers the entire card.

In this case it's essential to prevent the button from receiving pointer events, otherwise it wouldn't be possible to select text or interact with the card content. For sighted keyboard users, it will seem as though the card itself is in the focus order, while the button's action is still effectively available to pointer users, since they can also trigger a flip by clicking the card:

.faces > button {
    background: transparent;
    border: none;
    border-radius: 0.6rem;
    height: 100%;
    margin: 0;
    pointer-events: none;
    width: 100%;
}
.faces > button::before {
    content: none;
}
.faces > button:disabled {
    filter: none;
    opacity: 1;
}

Table of contents

Testing the focus hook element

The focus hook is the element that receives focus during a card transition. The focus hook isn't announced or visibly displayed, but its :focus-visible state is used to maintain the flip button's outline, when the button itself isn't focused:

.card > [tabindex="-1"]:not([hidden]) {
    display: inline-block;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    z-index: -1;
}
.card > [tabindex="-1"]:focus {
    outline: none;
}

[tabindex="-1"]:focus-visible + .faces > button {
    outline: 0.15rem solid var(--outline-color);
    outline-offset: 0.15rem;
}

If you're making significant changes to the flip card's structural styling, then it may be helpful to make the focus hook temporarily visible, to confirm that its layout position is correct, for example:

.card > [tabindex="-1"]:not([hidden]) {
    background: rgba(255,0,0,0.25);
    outline: 0.3rem solid #f00;
    z-index: 1;
}

Table of contents


JavaScript

The FlipCard class is structured as an export module, or you can convert it to a regular class declaration if that's preferred. Any number of instances can exist on a single page, each of which is created using the FlipCard constructor:

const demo = new FlipCard("#demo");

The argument is a selector query, that specifies a single group container element.

Table of contents

Cards with interactive content

Pointer users can trigger a flip by clicking the whole card, however this could potentially conflict with events on other interactive content (e.g., buttons or links inside the card). To avoid that problem, the whole-card click only applies if the pointer target isn't an interactive element, as specified by a second argument to the FlipCard constructor:

const demo = new FlipCard("#demo", "a[href], button, input");

The argument is a selector query, that should specify any interactive elements the card might contain (or defaults to "button" if undefined).

So whole-card clicks are conditionally ignored, if the pointer target is (or is inside) any element that matches the specified selector. They're also ignored if the pointer action resulted in text selection.

Table of contents

How the rotation is monitored

The displayed face changes in the middle of the transition, so we have to monitor the transform in real-time to know when it reaches that point. It needs to look like we're viewing two sides of the same card, and any obvious display swap would undermine that illusion.

This information is not provided by native APIs (CSS transitions and animations don't provide a frame event), but we can create a custom method to monitor their changes, with a combination of requestAnimationFrame() and getComputedStyle().

The following code retrieves the matrix3d string from computed style, converts it to a DOM Matrix, then calculates the rotation angle in degrees:

const matrix = new DOMMatrixReadOnly(this.css.getPropertyValue('transform'));
const rotation = Math.acos(matrix.a) * (180 / Math.PI);

This is called from a function triggered by requestAnimationFrame(), which is very unlikely to ever occur at precisely 90°, so we check for the point when it's only just greater or less, depending on the flip direction:

if((flags.back && rotation >= 90) || (flags.front && rotation <= 90)) {
    //swap the displayed face
}

Else if it's not close enough, then iterate again on requestAnimationFrame(), until it is.

Table of contents

How the focus hook is silent

This is a bit of a hack! But it's logically sound, semantically valid, and more to the point — it works.

Depending on the screen reader (they all vary in this respect), focusing an empty element would cause the parent group to be re-announced, or the element announced as blank, and this could still occur even with whitespace-only text content. Whitespace is still required so that the element isn't empty, but its announcement behavior can be overridden by defining an aria-roledescription that can't be announced.

This is achieved with a unicode non-character, which is technically not supposed to exist in a document at all. It's designed to be used programmatically for things like parsing delimiters, but the specification expects them to not be removed if any are present. It's impossible to announce, because it isn't mapped to a character, and the end result is that nothing is announced:

<span role="note" aria-roledescription="&#xffff;" tabindex="-1">&nbsp;</span>

Table of contents


That’s all from me! (from here)

With thanks to Aditya Jainapur, Hans Hillen, Ricky Onsman, Doug Abrams, Tj Squires, and Isabel Holdsworth, for their useful ideas and feedback during development. I welcome any thoughts, ideas, or feedback you might have on the concepts and solutions, or anything else.

Here are the demos and codebase links again:


Image credit: Resource Database.

Like to be notified about more articles like this? Subscribe to the Knowledge Center Newsletter. It not only gives you summaries and links to our technical blog posts but also TPGi webinars, podcasts, and business blog posts – as well as accessibility and web tech conferences and other events, and a reading list of other relevant articles. You get one email a month, it’s free, requires just your email address, and we promise we won’t share that with anyone. Check the archive.

The post Creating a truly accessible Flip Card appeared first on TPGi — a Vispero company.

❌