216digital.
Web Accessibility

Phase 1
Web Remediation for Lawsuit Settlement & Prevention


Phase 2
Real-World Accessibility


a11y.Radar
Ongoing Monitoring and Maintenance


Consultation & Training

Is Your Website Vulnerable to Frivolous Lawsuits?
Get a Free Web Accessibility Audit to Learn Where You Stand
Find Out Today!

Web Design & Development

Marketing

PPC Management
Google & Social Media Ads


Professional SEO
Increase Organic Search Strength

Interested in Marketing?
Speak to an Expert about marketing opportunities for your brand to cultivate support and growth online.
Contact Us

About

Blog

Contact Us
  • Keyboard Accessibility: A Guide for Web Developers

    Think about the last time you visited a website with a complex menu or a long list of links. If you tried navigating without a mouse—maybe because you found it faster to use the Tab key—you might have encountered invisible outlines, a random tab order, or even getting stuck in a popup with no clear way out. These problems highlight why keyboard accessibility is essential.

    When websites are built so that every button, link, and form field is accessible via keyboard, it becomes easier for everyone to navigate and complete tasks.

    What Is Keyboard Accessibility?

    At its core, keyboard accessibility ensures that everything on a website can be reached and used without a mouse. This is crucial for people with motor impairments who rely on keyboards or assistive devices, as well as users with visual impairments who navigate with screen readers. Even power users benefit, often finding keyboard shortcuts and navigation faster than using a mouse.

    Beyond improving usability, proper keyboard accessibility leads to better-organized code and a more logical page structure—benefits that search engines reward with better SEO rankings. Simply put, improving keyboard accessibility benefits both users and website owners. However, achieving it comes with challenges.

    Common Keyboard Accessibility Challenges

    Despite its importance, keyboard accessibility is often overlooked. Many websites suffer from poor focus visibility, illogical tab orders, and keyboard traps that frustrate users. Addressing these pitfalls is key to creating a smooth, user-friendly experience.

    Below are three of the most common keyboard accessibility issues—and how to fix them.

    1. Designing Effective Focus Indicators

    Focus indicators visually highlight which element is currently selected when navigating with a keyboard. They help users track their position as they move through a webpage using the Tab key.

    Why Focus Indicators Matter

    Imagine navigating a website solely by keyboard. If you press Tab but can’t see where you are because the focus highlight is too faint—or missing altogether—you’re left guessing. This creates confusion and frustration. Clear, high-contrast focus indicators ensure users always know where they are on the page.

    Best Practices for Focus Indicators

    • Outline thickness: At least 2 CSS pixels
    • Outline offset: Keep at least 2 CSS pixels between the outline and the element’s edge
    • Contrast ratio: A minimum of 3:1 between the focus indicator and the background

    Understanding the :focus-visible Pseudo-Class

    The :focus selector applies styles whenever an element gains focus, including when it’s clicked with a mouse. But :focus-visible applies focus styles only when an element is navigated via keyboard, keeping the interface clean for mouse users while ensuring keyboard users get clear visual cues.

    Example:

    *:focus-visible {
      border: 2px solid black; /* Ensure noticeable contrast */
      outline-offset: 2px;
    }

    2. Maintaining a Logical Navigation Order

    Users navigate websites sequentially using the Tab key. The focus order should match the visual layout to avoid confusion. A mismatch disrupts the browsing experience, making it difficult for users to predict what comes next.

    Tips for Logical Navigation

    • Use proper HTML structure: Semantic elements like headers (<h1> – <h6>), lists, and landmarks guide screen readers and browsers to interpret content correctly.
    • Avoid positive tabindex values: Manually setting a positive tabindex can force elements into an unnatural order, leading to confusion.
    • Provide “Skip to Main Content” links: These allow users to bypass repetitive navigation and jump straight to the main content.
    • Beware of keyboard traps: Ensure users can always navigate away from popups, modals, or embedded elements using only the keyboard.

    3. Proper tabindex Implementation

    The tabindex attribute controls how elements receive focus. While useful in some cases, it’s often misused.

    What tabindex Does

    • tabindex="0": Inserts the element into the default tab order based on its position in the DOM. Ideal for custom interactive elements like <div> buttons.
    • tabindex="-1": Removes an element from sequential keyboard navigation but allows focus via scripting. Useful for modals or hidden elements.
    • Positive values (e.g., tabindex="1"): Best avoided, as forcing a custom order can break the expected tab sequence and frustrate users.

    Best Practices

    • Use semantic HTML (<button>, <a>), which is naturally keyboard-accessible.
    • Avoid adding tabindex to non-interactive elements like text or static images.
    • Use negative tabindex for hidden or modal content that should only receive focus under certain conditions.
    • Stick to the natural tab order whenever possible—custom focus orders should be a last resort.

    Testing Your Website’s Keyboard Accessibility

    Even with best practices in place, testing is essential to catch issues before they impact users. A combination of manual and automated testing provides the most reliable results.

    Manual Testing

    • Navigate using only a keyboard: Use the Tab key to move through all interactive elements. Press Enter (or Space) to activate buttons and links.
    • Check focus visibility: Ensure focus indicators are always clear and meet contrast requirements.
    • Verify logical tab order: Does the sequence make sense based on how someone would naturally read or navigate your page?
    • Watch for keyboard traps: Ensure modals, dropdowns, and embedded content allow users to navigate away freely.

    Automated Testing Tools

    Browser-Based Tools

    • Firefox Accessibility Inspector: Displays how the browser interprets focusable elements.
    • Chrome DevTools (Accessibility Panel): Helps analyze the site’s structure.
    • WAVE Evaluation Tool: Flags potential accessibility issues directly in the browser.

    While these tools are powerful, nothing replaces real user feedback. Testing with people who rely on keyboard navigation often reveals hidden issues automated tools miss.

    Conclusion

    Keyboard accessibility is a fundamental part of inclusive web design. Making sure users can navigate your site without a mouse ensures better usability for everyone—including people with disabilities who rely on keyboard navigation. Plus, it improves SEO, usability, and compliance, making it a win-win for both users and businesses.

    The best practices covered here—such as customizing focus indicators, maintaining a logical tab order, and using tabindex responsibly—are essential steps toward a more accessible website. Regular testing, both manual and automated, helps ensure your site meets WCAG guidelines and delivers a smooth experience for all users.

    For expert guidance, consider working with accessibility professionals like 216digital. Specialists can help you implement strategies that go beyond basic compliance, ensuring long-term usability and inclusivity. When you prioritize keyboard accessibility, you create a more welcoming web for everyone—and that’s a goal worth striving for.

    Greg McNeil

    March 13, 2025
    How-to Guides
    Accessibility, keyboard accessibility, Keyboard Navigation, tabindex, Web Accessibility, web developers, web development
  • How to Make Mega Menus More Accessible

    A mega menu is typically a large, two-dimensional panel that appears when a user interacts with a top-level navigation item. It’s often used by eCommerce stores or websites with many different product categories or content sections. Because it can display a wide variety of links in a single view, a mega menu helps visitors explore your site quickly—no endless drilling down into submenus.

    But here’s the catch: while mega menus make navigation simpler for many users, they can also create barriers for some. For example, hover-triggered mega menus might be useless for someone relying on a keyboard. Or, if the menu isn’t properly labeled, a screen reader user might get stuck in a confusing loop of unlabeled links.

    These barriers matter because web accessibility is not just about following rules—it’s about ensuring everyone can use your site. If you leave people out, you risk alienating customers who want to purchase your products or read your content. So, let’s dive into some common accessibility issues and how to fix them.

    Overcoming Common Accessibility Challenges

    Improving Hover Functionality

    Most mega menus open when you hover your mouse over the navigation item. However, hover-based menus can cause big problems for keyboard users (or anyone who can’t use a mouse).

    • Inaccessible for Keyboard Users: People who navigate with the keyboard use the Tab key to move from link to link. If a menu only opens on hover, these users can’t open the submenu.
    • Overly Sensitive Interactions: Sometimes, mega menus can pop open or shut at the slightest movement of your mouse. This makes them frustrating to use for everyone.
    • The “Diagonal Problem”: If you move the mouse at an angle, you can sometimes trigger submenus you didn’t intend to open.

    Best Practice: Use a click to open the submenus instead of relying on hover. This way, both mouse and keyboard users have a more predictable experience. A click is a clearer signal of intention, reducing accidental openings or closings.

    Making Menus Easy to Close

    A menu that’s hard to dismiss can trap users, especially if it covers a large portion of the screen. On the other hand, a menu that closes too quickly can frustrate users who accidentally hover away for a split second.

    Solutions:

    1. Escape Key Support: Let users close the menu by pressing the Escape key. This is a standard expectation in many UI patterns and helps keyboard users exit quickly.
    2. Delayed Closing: If you decide to keep some hover functionality, add a slight delay before the submenu disappears. This grace period prevents the menu from closing by mistake if a user’s pointer drifts outside the panel for a moment.

    Enhancing Keyboard Accessibility

    Logical Keyboard Navigation

    Keyboard navigation is a critical part of web accessibility. You want the user’s Tab key presses to move in a clear, intuitive order:

    1. First Tab: Highlight the first top-level navigation item.
    2. Enter Key: If the focused top-level item has a submenu, pressing Enter opens that submenu. Pressing Enter again on any submenu item activates the link.
    3. Tab Within a Submenu: Moves focus to the next item in the submenu.
    4. Escape Key: Closes the submenu and returns focus to the parent menu item.
    5. Shift + Tab: Moves backward through the items, letting users navigate in reverse.

    This logical flow ensures that people who rely on the keyboard won’t get lost or stuck.

    Providing Clear Focus Indicators

    When users press Tab, they should be able to see exactly which menu item is highlighted. This means using visible focus indicators:

    • A change in background color, an underline, or a bold outline helps users quickly spot the focused item.
    • Make sure the color contrast meets accessibility guidelines. Avoid using color alone—some users might not see color differences clearly. An underline or border is a more reliable visual cue.

    Optimizing Screen Reader Support with ARIA

    Choosing the Right ARIA Roles

    Using role= "menu" for all navigation is a common mistake introduced in development. This role should only be used if your navigation behaves like a desktop application menu. For most website mega menus, it’s better to use simpler roles.

    Recommended roles and attributes:

    • role= "navigation": Declares that this section is a navigation landmark, which helps screen reader users quickly find or skip it.
    • role= "menuitem": If you have interactive items that function like menu items (though for basic links, standard <a> elements might be enough).
    • aria-haspopup= "true": Indicates that a button or link has a submenu.
    • aria-expanded= "false": Tells screen readers if a section is closed. Switch it to true when the submenu opens.

    Labeling and Describing Elements Properly

    Screen readers need helpful labels to convey what the link or button does. If your button opens a “Products” submenu, label it clearly:

    • Use aria-label= "Products Menu" or aria-labelledby=" [ID_of_label]" to associate a descriptive label with the menu.
    • Provide descriptive link text. Instead of “Click here,” use something like “View our latest products.” This helps all users know exactly where the link leads.

    Implementing Accessible Mega Menus with HTML, CSS, and JavaScript

    Using Semantic HTML for Proper Structure

    Below is a simple example showing how to structure an accessible mega menu:

    <nav aria-label= "Main Menu">
      <ul>
        <li><a href="#">Home</a></li>
        <li>
          <button aria-expanded="false" aria-haspopup="true">Products</button>
          <ul>
            <li><a href="#">Product 1</a></li>
            <li><a href="#">Product 2</a></li>
          </ul>
        </li>
      </ul>
    </nav>

    Here’s why this works:

    • <nav aria-label= "Main Menu">: The <nav> element is a semantic way to mark the navigation area. The aria-label helps screen readers identify it.
    • <button> vs. <a>: Using a button for expandable menus is more accessible because it’s an interactive element by default and can easily handle the aria-expanded state.
    • aria-expanded: Indicates whether the submenu is open or closed (true or false).

    Styling Menus for Visibility & Interaction

    Accessible styling goes beyond making things “look nice.” It ensures that focus states are clear. For instance:

    nav button:focus {
      outline: 2px solid #005ea2;
      background-color: #f1f1f1;
    }
    nav ul ul {
      display: none;
    }
    nav button[aria-expanded="true"] + ul {
      display: block;
    }
    • The outline property and background-color change help users see the focused button.
    • By default, submenus are hidden (display: none).
    • When aria-expanded= "true", the submenu appears (display: block).

    Enhancing Usability with JavaScript

    A small amount of JavaScript can make your menus more accessible. Here’s how you can toggle the aria-expanded attribute:

    document.querySelectorAll('nav button[aria-haspopup]').forEach(button => {
      button.addEventListener('click', () => {
        const expanded = button.getAttribute('aria-expanded') === 'true';
        button.setAttribute('aria-expanded', !expanded);
      });
    });
    • This code finds every button with aria-haspopup.
    • When clicked, it checks if aria-expanded is currently true, then toggles it.
    • This prevents menus from randomly opening on hover and gives users control.

    Accessible Navigation Is an Ongoing Commitment

    Building an accessible mega menu isn’t a one-and-done project. It takes careful planning, coding, and constant testing to make sure all users can move through your site with ease. However, the payoff is huge: better usability for everyone, including people with temporary or permanent disabilities, and compliance with accessibility standards like WCAG.

    Remember, accessibility benefits everyone. Even a user with a short-term injury or someone on a small mobile device can benefit from keyboard-friendly and screen-reader-friendly menus. By making small changes to HTML, CSS, ARIA attributes, and JavaScript, you can open up your site to a larger audience and provide a smoother experience for all.

    If you need expert guidance on web accessibility or want a thorough audit of your online store, 216digital can help. We specialize in creating inclusive, user-friendly experiences that keep your customers coming back and keep your website on the cutting edge of accessibility best practices. Don’t let your mega menus become mega barriers—start making them accessible today!

    Greg McNeil

    March 11, 2025
    How-to Guides
    Accessibility, accessible code, How-to, mega menu, web developers, web development, Website Accessibility
  • 6 Ways to Improve Icon Accessibility in Web Design

    Icons are everywhere in web design—on navigation menus, buttons, and even instructional graphics. They help users navigate, take action, and understand content at a glance. But just because an icon looks great doesn’t mean it’s effective for everyone. When it comes to creating inclusive websites, icon accessibility is crucial. If an icon is confusing or too small, it can frustrate users, create barriers, and even cost you traffic or conversions. That’s why accessibility and usability should be top priorities.

    In this article, we’ll explore six actionable ways to improve icon design so that your icons are clear, usable, and accessible to all users, including those with disabilities. Whether you’re a website owner, content creator, or web developer, these tips will help ensure your icons work well for everyone, including people with visual, motor, or cognitive impairments.

    1. Make Your Icons Easy to See

    Contrast Matters

    When designing icons, it’s significant that they stand out from the background rather than blend in. The Web Content Accessibility Guidelines (WCAG) recommend a contrast ratio of at least 4.5:1 for text and images of text. Icons, especially those carrying critical information, should meet or exceed this contrast standard.

    Why It’s Important

    Low-contrast icons can be almost invisible to users with vision impairments, complicating navigating or completing tasks on your site.

    How To Do It

    Tools like the WebAIM Contrast Checker can help you confirm that your color choices meet accessibility guidelines. If your background is light, ensure your icons are noticeably darker, and vice versa.

    Size Counts

    Just as crucial as contrast is icon size. Small icons can be a nightmare for users with poor vision or those who rely on assistive technology like screen magnifiers. They can also pose a challenge for people with motor disabilities who struggle to tap or click small icons accurately.

    Recommended size

    Aim for an icon touch target of at least 44×44 pixels. This size gives enough space for a user’s finger or cursor to select the icon without accidentally triggering something else.

    Common pitfalls

    Anything smaller than 24×24 pixels is typically too small to be easily clicked or tapped. If you’re designing for mobile, remember that users’ fingers are bigger than a precise mouse pointer.

    2. Always Pair Icons with Text

    Relying solely on icons can create confusion, especially if your visitors aren’t familiar with certain symbols. A perfect example is the infamous “hamburger menu.” While common in modern design, not everyone recognizes what the three stacked lines represent. By adding a text label, you remove any guesswork.

    Why It’s Important

    Text labels make icons understandable for users who might not recognize specific symbols. They also provide additional context for screen readers, who may not interpret icons alone correctly.

    • Bad example: A search button that shows only a magnifying glass icon.
    • Good example: Pair the magnifying glass icon with the word “Search.” This ensures clarity for everyone.

    Including text labels is a simple but effective step toward better icon accessibility and can drastically improve user experience.

    3. Use Clear, Functional Alt Text

    Alt text (alternative text) plays a vital role in accessibility. It’s a description that screen readers read aloud for users who can’t see the images on a page. Regarding icons, the alt text should describe the icon’s function rather than its appearance.

    • Examples: Bad: alt= “Icon of a house”
    • Good: alt= “Go to homepage”

    If the icon is purely decorative and conveys no essential information, mark it as aria-hidden= "true" or use an empty alt="" to keep screen readers from reading irrelevant content.

    Use Proper Coding Techniques

    Depending on the format of your icon, there are slightly different approaches to ensure screen readers interpret them correctly:

    1. <img> elements → Use the alt attribute, like alt=”Search button”.
    2. SVG icons → Provide a <title> tag within the SVG file or inline code.
    3. Icon fonts → Sometimes, screen readers treat icon fonts as text characters. Use aria-hidden= "true" for the icon itself, and include hidden text (e.g., <span class= "visually-hidden">Search</span>) for accessibility.

    This attention to detail ensures that people using screen readers will know the icon’s function without having to interpret a cryptic or generic description.

    4. Be Consistent with Icons

    Consistency is key in web design, especially regarding icon accessibility. Each icon should have a clear meaning across your entire website or app.

    Why It’s Important

    If you use a magnifying glass icon to indicate “Search” in one area of your site, using the same symbol for “Zoom” somewhere else can confuse users. A confused user is more likely to leave your site or miss important content.

    Avoid Multiple Meanings

    Don’t use one icon to represent more than one function. This can break user trust and make them second-guess every click.

    By keeping your icons consistent, you help users develop familiarity with the symbols on your site. Reducing the cognitive load for everyone, including users with disabilities who rely on screen readers or keyboard navigation.

    5. Make Icons Keyboard & Assistive Tech Friendly

    Some users cannot use a mouse or touchpad and rely solely on their keyboard. Others use assistive technology like screen readers or voice control. Ensuring your icons work with these tools is essential for accessibility.

    Keyboard Navigation

    Every interactive icon should be reachable and operable using only a keyboard. Users should be able to tab to an icon and activate it with the Enter or Spacebar keys.

    • Tips: Use logical tab ordering in your HTML to ensure icons follow a coherent navigation sequence.
    • Ensure focus styles are visible (e.g., a visible outline or highlight around the icon when selected).

    Screen Reader Support

    Icons can easily confuse screen reader users if not labeled correctly. This is where ARIA labels or hidden text come into play. For instance, if an icon triggers a search action, you could include an ARIA label such as aria-label= "Search" on the button element, or you can nest a visually hidden <span> that says “Search.”

    Why It Matters

    Without ARIA labels or hidden text, a screen reader might read the icon as a “button” or, worse, give no information.

    How To Do It

    <button aria-label="Search">
      <svg aria-hidden="true"> ... </svg>
      <span class="visually-hidden">Search</span>
    </button>

    Ensure keyboard and screen reader users have the proper context to interact with your icon.

    6. Choose the Right Icon Format

    Icons can be added to a webpage in several ways, but SVG and PNG are two of the most popular image formats. Alternatively, some designers opt for icon fonts. Each has its pros and cons when considering icon accessibility.

    SVG & PNG Are Your Friends

    SVG (Scalable Vector Graphics)

    • Pros: These files are resolution-independent, meaning they scale well to any size without losing quality. They can also be easily styled with CSS and annotated with titles or labels for accessibility.
    • Cons: If you’re unfamiliar with SVG syntax, the setup process can be more involved.

    PNG (Portable Network Graphics)

    • Pros: Excellent for icons that don’t need to scale up drastically. PNGs offer high-quality images with transparency.
    • Cons: They’re not always the best for large or small displays, as they can become pixelated or blurry when scaled.

    Beware of Icon Fonts

    Icon fonts replace letters with symbols, so the text “A” might visually display as a house icon. While this can be convenient, it can create issues for screen readers who might read the text as a letter rather than a graphic. If you use icon fonts:

    • ARIA: Add aria-hidden= "true" to ensure the screen reader ignores the font.
    • Hidden text: Include a visually hidden <span> with the function of the icon, such as “Home” or “Search.”

    By choosing the right format, you help ensure users can see or interact with the icon regardless of their device or abilities.

    Team Up with 216digital for Better Accessibility

    Mastering icon accessibility is more than just following guidelines; it’s about providing an inclusive experience for everyone who visits your website. Clear, intuitive icons can significantly improve your site’s usability, particularly for users who rely on assistive technologies.

    If you’re unsure where to begin or want to ensure accessibility experts handle every detail, consider partnering with 216digital. Our team has extensive experience creating accessible, user-friendly websites that work seamlessly across different devices and for people of all abilities. We’ll help you fine-tune every aspect of your icons, from contrast ratios and alt text to keyboard navigation and consistent design.

    Ready to level up your website’s accessibility? Contact us for a quick briefing and see how we can help strengthen your site’s icon design. Together, we can create a web experience that welcomes everyone, reflecting your brand values and maximizing your reach in a diverse online world.

    Greg McNeil

    February 14, 2025
    How-to Guides
    Accessibility, How-to, Icon Accessibility, web developers, web development, Website Accessibility
  • Creating Accessible Data for Charts and Graphs

    Data drives decisions. A clear and easy-to-understand chart can speak volumes whether you’re showing sales figures, survey results, or scientific findings. However, not everyone interprets visual elements the same way. People with low vision, color blindness, or who rely on screen readers may face serious barriers if your charts aren’t designed with accessibility in mind.

    Beyond inclusivity, legal standards exist like the Americans with Disabilities Act (ADA) and the Web Content Accessibility Guidelines (WCAG). In this post, we’ll explore why accessible data visualizations matter, review common accessibility mistakes, and share practical techniques you can use to ensure that all visitors can understand your charts and graphs.

    Designing for Visual Accessibility

    Color Contrast in Charts and Visualizations

    Color contrast plays a crucial role in readability, especially for users with visual impairments. According to WCAG SC 1.4.3: Contrast (Minimum, the standard text should have a contrast ratio of at least 4.5:1, while large text (18pt or 14pt bold) requires a minimum of 3:1. These guidelines also apply to key chart elements, including labels, axes, and text within visualizations, ensuring that information remains clear and accessible to all users.

    To check your color choices, use tools like WebAIM’s Contrast Checker or Chrome DevTools’ built-in accessibility features. If your text lacks sufficient contrast, consider adjusting to darker text on lighter backgrounds or using bolder, larger fonts. Prioritizing accessible data in your visualizations not only enhances clarity but also improves the user experience for a wider audience.

    Avoiding Color-Only Differentiation

    When a chart relies on color alone to show differences in categories—like red for “loss” and green for “gain”—users with color blindness might not be able to tell them apart. WCAG SC 1.4.1 (Use of Color) emphasizes that color can’t be the only method used to communicate information.

    To fix this, you can:

    • Use patterns or textures in bar charts or pie slices.
    • Add direct labels or annotations next to the data points.
    • Include icons or distinct shapes to differentiate data series.

    Scalability and Zoom Support

    Many people need to zoom in to read small text or fine details. According to WCAG SC 1.4.4(Resize Text), users should be able to zoom up to 200% without losing content or functionality. Test how your charts scale on both desktop and mobile screens. This may involve using scalable vector graphics (SVG) or ensuring your chart library supports responsive resizing.

    Providing Text Alternatives and Descriptive Labeling

    Alt Text for Simple Charts

    For simpler charts—like a basic bar chart comparing two or three items—brief alt text can be enough. This alt text should include the following:

    • The overall trend or purpose of the chart (e.g., “A bar chart comparing monthly sales in January and February…”).
    • Key numbers or comparisons (if they’re crucial to understanding the data).

    Avoid including every detail if it’s not necessary. Alt text is meant to be concise yet informative.

    Breaking Down Complex Data with Text Summaries

    If your chart is more detailed—perhaps showing multiple data series or a longer timeline—alt text alone won’t cover it. In that case, it’s better to provide a text summary that covers the main insights:

    • Describe what the chart is measuring (“Average temperature trends across five cities…”).
    • Highlight any interesting data points or outliers (“City A had a significantly higher temperature in July…”).
    • Provide overall conclusions that help readers understand key takeaways.

    Using ARIA for More Detailed Descriptions

    If a simple alt text or summary doesn’t do your data justice, you can use aria-describedby to link your chart to a more extended description elsewhere on the page. This approach ensures screen reader users have access to more in-depth data without crowding the main alt text.

    When writing these extended descriptions:

    • Keep your text organized with headings or bullet points.
    • Clearly label each section so users know what information they’re accessing.
    • Make sure screen readers can announce the description properly by placing it in a logical spot on the page or using hidden text if necessary.

    Structuring Data Tables for Screen Readers

    Another highly accessible way to present data is through tables. If you can’t convey the full meaning of a chart in alt text, consider adding a well-structured HTML table. Be sure to:

    • Use <th> elements for headers.
    • Include a <caption> that describes the table’s purpose.
    • Provide a summary if the table is complex.

    For example:

    <table>
      <caption>Monthly Sales for Q1</caption>
      <thead>
        <tr>
          <th scope="col">Month</th>
          <th scope="col">Sales ($)</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="row">January</th>
          <td>10,000</td>
        </tr>
        <tr>
          <th scope="row">February</th>
          <td>12,000</td>
        </tr>
        <tr>
          <th scope="row">March</th>
          <td>9,500</td>
        </tr>
      </tbody>
    </table>

    Well-coded tables help screen readers identify the rows, columns, and header relationships.

    Making Interactive Charts and Graphs Accessible

    Keyboard Navigation and Focus Management

    If your chart is interactive—allowing filters, tooltips, or zoom functions—it’s crucial that all features are accessible by keyboard alone. This means:

    • Users should be able to tab through each interactive element.
    • The focus order should make sense, moving in a logical sequence.
    • Dropdowns, sliders, or filters must also be operable without a mouse.

    By implementing these best practices, you can guarantee accessible data interactions for all users, including those who rely on keyboard navigation.

    Ensuring Tooltips and Popups are Accessible

    A big challenge is making sure that tooltips triggered by hovering can also be triggered by keyboard actions, like pressing the Enter or Space keys. Also, make sure each tooltip has an accessible name and description so screen readers can announce it properly. WAI-ARIA attributes like role= "tooltip" and aria-hidden= "false" (when the tooltip is visible) can help.

    Using Semantic HTML and ARIA Roles

    Use semantic HTML elements like <svg> for vector graphics where possible. If you’re using <canvas> or more complex libraries, add proper ARIA roles and states so screen readers know how to interpret them. Clear focus indicators are also important so users can see where they are when tabbing through interactive features.

    Choosing Static vs. Interactive Charts

    Interactive charts can be powerful, but they’re not always the best choice for every audience. Sometimes, a well-labeled static chart is more accessible data and easier to understand. If you have users who need data quickly and without extra steps, offering both a static image and an interactive version can meet multiple needs.

    Selecting and Adapting Chart Types for Accessibility

    Accessible Bar Charts

    Bar charts are among the easiest to make accessible, as long as you:

    • Clearly label each bar.
    • Use more than color to differentiate bars—consider patterns or direct labeling.
    • Provide a descriptive axis label so users know what each bar represents.

    Accessible Line Graphs

    Line graphs can be tricky for those with low vision. To improve accessibility:

    • Use different line styles (solid, dashed, dotted) to distinguish multiple data sets.
    • Add shape markers at each data point so color-blind users can still tell them apart.
    • Make sure your axes and legends are clear, with sufficient contrast.

    Accessible Pie Charts

    Pie charts can be confusing when there are too many slices. Limit your chart to a small number of slices and label each piece directly. Also, add patterns or textures if you use color coding. If your data is too complex, think about using a different format, like a table or bar chart.

    Handling Complex Data Visualizations

    If your data is large or contains many variables, consider breaking it down into smaller charts. This approach, called “small multiples,” allows users to compare data across several simpler charts rather than one overwhelming visualization. Include thorough text explanations and summaries to give context and help users understand the bigger picture.

    Advanced Accessibility Techniques for Charts and Data Displays

    Providing Multiple Data Views

    Not everyone can interpret data in the same way, so offering a toggle between a chart view and a table view can be extremely helpful. For example, you could have a button labeled “Show Data as Table” that, when clicked, reveals an accessible HTML table with the same information.

    Supporting Screen Readers with Data Annotations

    For charts that update in real-time—like stock price tickers—add announcements with ARIA live regions if something significant changes. This way, screen reader users will be notified when new data appears, but be careful not to overload them with constant updates.

    Making Dynamic and Real-Time Data Accessible

    Real-time data can be challenging because it often changes so frequently. Focus on essential changes and clearly label them. If you’re running live dashboards or analytics that refresh, allow users to control the refresh rate or pause the updates. This helps users keep track of what’s changed without confusion.

    Testing and Validating Chart Accessibility

    Manual Testing with Assistive Technologies

    Always test your charts using real assistive tools such as:

    • Screen readers like  NVDA, JAWS, or VoiceOver.
    • Keyboard-only navigation for all interactive elements.

    This hands-on testing helps you catch issues that automated checkers might miss, like poor focus order or unannounced chart labels.

    Automated Testing Tools

    Tools like WAVE Accessibility Checker and Lighthouse’s Accessibility Audit in Chrome can highlight potential problems. However, automated tools can only find about 30% of accessibility issues, so don’t rely on them alone.

    User Testing and Real-World Validation

    Finally, the best way to confirm that your data visualizations are truly accessible is to test them with actual users who rely on assistive technology. Gather feedback and be prepared to iterate on your design. Accessibility is an ongoing process that benefits greatly from real-world input.

    Creating Data-Driven Experiences for All Users

    Inclusive data visualizations aren’t just a courtesy—they’re the key to truly understanding and acting on the information that drives our businesses, classrooms, and communities. By deliberately designing charts and graphs that everyone can parse, you’re ensuring your message resonates with the widest possible audience. You’re also upholding the principles of equality, transparency, and innovation that propel the web forward.

    Start your journey toward full web accessibility today—reach out to 216digital using the form below! Our team of accessibility experts is ready to assess your site and provide tailored solutions to ensure that all visitors can easily access your content.Don’t let accessible data remain an afterthought—take the first step toward a more inclusive online presence now.

    Greg McNeil

    February 12, 2025
    How-to Guides
    Accessibility, Accessible Data, How-to, Web Accessibility, web developers, web development, Website Accessibility
  • Accessibility Barriers: The Problem with Placeholders

    Form design might seem simple at first. You add text fields, maybe a dropdown or two, and call it a day. But when it comes to guiding users, many designers rely on placeholders to show instructions or examples inside the input fields. On the surface, this seems like a neat way to save space and keep the layout clean. However, those same placeholders can create big usability and accessibility issues.

    If you’ve been counting on placeholders to label your form fields, it might be time to rethink your approach. In this article, we’ll explore why placeholders cause problems, especially for people with disabilities, and how you can design forms that are clearer and easier for everyone to use.

    Why Placeholders Cause Problems in Forms

    1. They Disappear When Users Start Typing

    Picture this: a user clicks on a field that says “Enter your phone number,” the moment they begin typing, that instruction vanishes. If they suddenly forget the exact format or details required, they have to either clear the field to see the placeholder again or guess what was there in the first place. This can be annoying in simple fields, but it becomes a real headache in longer or more complex forms. Each additional step or moment of confusion can lead to higher drop-off rates and reduced accuracy.

    2. Not All Browsers Support Them

    Although modern browsers generally display placeholders, some older or less common browsers may not. When these browsers skip placeholders altogether, the user has zero guidance or instruction for the field. If your form is already barebones—meaning you’ve omitted labels or separate hint text—people on unsupported browsers are left to figure it out on their own. This can be especially problematic when international or low-tech audiences may rely on older systems.

    3. Once Filled, Fields Lose Context

    After a user inputs data into a field, the purpose of that field may not be obvious. This is especially true for details like phone numbers, ZIP codes, or other specialized information. Without visible labels, users who step away from their screens or return later might forget the exact context for each field and whether it requires a specific format (e.g., whether to include country codes or parentheses for phone numbers).

    4. Reviewing Answers Becomes a Hassle

    Many people like to review their answers before hitting the Submit button. However, if placeholder text disappears once the user types something in, they can’t quickly verify whether their entry meets the field’s requirements. This can lead to overlooked mistakes—like mixing up month and day in date fields or forgetting to include a state abbreviation in an address.

    5. Fixing Errors Gets Confusing

    When a form returns an error message, it often refers to a specific label or hint. Without a visible label, a user might only see a generic error message like “Invalid entry” without knowing how to fix it. They’re left guessing whether they must add a certain number of characters, switch from text to numbers, or follow a specific pattern. This guesswork can be frustrating and lead to abandoned forms.

    6. Some Browsers Hide Placeholders When the Field Is Focused

    In certain older browsers, clicking or tabbing into an input field removes the placeholder immediately. Suppose a user didn’t fully absorb the instructions beforehand. In that case, they’ll have to navigate out of the field and back in, or potentially delete any typed text, to see the placeholder again. It’s a minor issue but yet another piece of friction.

    7. They Can Be Mistaken for an Actual Answer

    Placeholder text usually has a lighter contrast to differentiate it from actual user input, but the difference can be subtle. Some users might assume the placeholder is pre-filled data and skip the field altogether. Or they might try to erase the text, only to realize it’s a placeholder, not a typed entry.

    8. Low Contrast Makes Them Hard to Read

    One frequent design choice is to make placeholders light gray. This aesthetic might look sleek but can be challenging to read for people with visual impairments or even those using a device in bright sunlight. Low contrast is a direct accessibility barrier and may violate the  Web Content Accessibility Guidelines (WCAG) guidelines, which recommend sufficient contrast between text and background.

    9. Some Screen Readers Don’t Read Placeholder Text

    Screen reader support for placeholders is inconsistent. Some devices or assistive tools ignore placeholders entirely, leaving users no context. If you rely on placeholders to communicate critical instructions, this group of users may miss out on the information they need.

    10. Smaller Clickable Area Without Labels

    When you have a label element associated with a form field, clicking the label sets focus on that field. This feature is handy, especially for people with motor impairments who benefit from a larger clickable target. Without a proper label, users might have to click precisely on the field, which can be more complicated.

    11. Placeholder Text Gets Cut Off

    Long placeholder text often doesn’t fit in the space provided, so it gets truncated. If the most crucial part of the instruction is at the end—like a date format or suffix—it may not be visible. Mobile users, in particular, have limited screen space, making it even more likely that critical instructions get chopped.

    12. Some Browsers Don’t Translate Placeholders

    If you depend on browser-based translation (like Google Translate in Chrome), remember that these tools don’t always translate placeholder text. International users might see fields with instructions in a language they don’t understand, putting them at a disadvantage.

    13. Auto-Complete Can Mess Things Up

    Browsers often auto-fill fields such as name or email based on saved user information. When that happens, the placeholder text is never shown. If the user doesn’t recall the exact format needed—like whether the phone number should include a dash or parentheses—they might submit the wrong thing without even realizing it.

    14. High Contrast Mode Makes Placeholders Look Like User Input

    High Contrast Mode in Windows can shift placeholder text to the same color as regular text. In that situation, a placeholder might appear identical to actual input, confusing users who think the field is already filled in or assume it’s a default value.

    What You Should Do Instead

    Rather than relying on placeholders, consider these best practices:

    Use a Visible Label

    Make sure every form field has a label that stays on the screen. Labels tell users—sighted, low vision, or blind—what the field is for. They also help screen reader users navigate more easily.

    Put Hint Text Below the Label

    If you need to offer more guidance, place this text below or next to the label. This way, the hint stays visible all the time. It won’t disappear once someone starts typing.

    Provide Clear Formatting Instructions

    Instead of relying on placeholders, add clear examples outside the input field. For instance, you could show “MM/DD/YYYY” under the “Date of Birth” label. Users can see the format without losing the prompt.

    Test for Accessibility

    Test your forms with screen readers and try them in high-contrast mode. Check that the labels are clear, that hint text stands out, and that the form works well even if placeholders don’t show up at all. Tools like WAVE or Google Lighthouse can help identify accessibility barriers.

    Consider Better UX Patterns

    Inline validation, tooltips, or progressive disclosure can guide users in a more reliable way. These methods let users see error messages or instructions at just the right time, without losing any important label text.

    Clear Forms, Better Experiences

    Using placeholders might seem like a clean and modern design choice, but it often causes more trouble than it’s worth. From disappearing instructions to accessibility issues, placeholders can leave users frustrated and unsure. Instead of relying on placeholders, give each field a clear label and keep helpful guidance visible. By doing so, you’ll create a smoother, more inclusive experience for everyone who visits your site.

    Need help making sure your forms are user-friendly and accessible? 216digital specializes in improving digital experiences for all users. Reach out to us today to learn how we can help you design better, more inclusive forms—no placeholders needed.

    Greg McNeil

    February 6, 2025
    How-to Guides
    Accessibility, How-to, Web Accessibility Remediation, web developers, web development, Website Accessibility
  • Why No ARIA Is Better Than Bad ARIA

    It’s tempting to think of ARIA (Accessible Rich Internet Applications) as the one-stop solution for all your accessibility needs. After all, ARIA exists to help developers create web content that works better for people who use assistive technology, like screen readers. But here’s the catch: if you misuse ARIA—or in places where it isn’t needed—you can end up making your site less accessible, not more.

    This post will explain why semantic HTML should always be your go-to approach, when and why ARIA is beneficial, the most common ARIA mistakes, and best practices for getting it right. By the end, you’ll see how “less is more” often applies to ARIA and why sticking to native elements can save you—and your users—a lot of trouble.

    What Is ARIA (and Why Does It Matter)?

    ARIA stands for Web Accessibility Initiative – Accessible Rich Internet Applications. Created by the World Wide Web Consortium (W3C), ARIA provides a set of roles, states, and properties that help assistive technologies (like screen readers) understand the meaning and function of different elements on a webpage. It’s beneficial for complex or dynamic interfaces that native HTML elements don’t fully cover—such as custom sliders or tab interfaces.

    However, the real power of ARIA depends on how it’s used. Applying ARIA roles in the wrong places or mislabeling states can lead to confusion and errors. Users relying on screen readers might hear incorrect information about what’s on the page or even miss out on essential controls. If you’re not cautious, you could do more harm than good.

    Why Semantic HTML Should Be Your First Choice

    Before jumping into ARIA, remember that semantic HTML is the foundation of accessible web design. Native elements, like <header>, <nav>, <button>, and <footer>, come with many built-in features that screen readers and other assistive tools already understand.

    What is Semantic HTML?

    It refers to HTML elements that clearly describe their meaning. For instance, a <nav> element signals that it contains navigation links. A <button> says, “I’m something clickable!” to both users and screen readers.

    Why Does it Matter?

    When you use semantic elements, you’re using markup that browsers and screen readers know how to interpret. This often means you don’t need ARIA at all—because everything is already handled for you.

    Real-world Example

    If you need a button, just use <button> instead of a <div> with role= "button". Screen readers automatically identify a <button> as a button, while a <div> is just a generic container. Adding a role= "button" to that <div> can work, but it’s extra code and is often less reliable than using a <button> in the first place.

    By relying on these built-in elements, your code is simpler and more intuitive. You’re also less likely to cause confusion when you mix ARIA roles with native roles.

    When (and Why) ARIA Is Actually Needed

    So, if semantic HTML is so powerful, why do we have ARIA at all?

    Filling the Gaps

    HTML is great, but it’s not perfect. Some interactive elements—like complex sliders, tab panels, or sortable tables—aren’t natively supported (or are only partially supported) by standard HTML tags. ARIA helps fill in these gaps by providing additional metadata.

    Roles, States, and Properties

    ARIA is split into three main categories: roles (what is this thing?), states (what is its current condition?), and properties (how does it behave?). These allow screen readers to give users a clearer picture of what’s happening on the page.

    Example: Tabs and sliders

    If you’re building a tab interface from scratch, you might rely on a series of <div> elements. You’d need ARIA attributes like role= "tablist", role= "tab“, and role= "tabpanel", plus properties like aria-selected= "true" or aria-hidden= "true" to show which tab is active.

    Ultimately, ARIA becomes crucial when the default HTML elements don’t cover the level of interactivity or complexity you need. That might be a custom widget or a specialized interface that doesn’t map neatly to existing HTML tags.

    The Most Common ARIA Mistakes (and Why They’re a Problem)

    Misusing Roles

    Sometimes, developers add ARIA roles to elements out of habit, without stopping to see if the native element would have worked better. If you set role= "button" on a <div>, you must also manually manage keyboard interactions and focus states. If you don’t, assistive technology users may be unable to click or navigate to this “button” effectively.

    Example

    <!-- Not so good -->
    <div role="button" tabindex="0" onclick="doSomething()">
      Click me
    </div>
    
    <!-- Better -->
    <button onclick="doSomething()">Click me</button>

    Using a <button> means you get keyboard focus, click events, and screen reader recognition by default—no extra ARIA or scripting needed.

    Redundant or Conflicting Roles

    Many elements come with built-in roles. A <nav> element is understood as “navigation,” and a <ul> is understood as a list. If you add role= "navigation" to a <nav>, you’re restating something already known. In some cases, overriding a native role with a custom role can even interfere with how assistive technologies interpret the element.

    Example

    <!-- Not so good -->
    <nav role="navigation">
      <!-- Navigation links here -->
    </nav>
    
    <!-- Better -->
    <nav>
      <!-- Navigation links here -->
    </nav>

    Here, adding role= "navigation" is unnecessary and could create confusion in some tools.

    Incorrect State Management

    ARIA states, like aria-expanded or aria-checked, must accurately reflect the element’s real condition. If your dropdown menu is closed but you have aria-expanded= “true”, a screen reader user will hear that the menu is open—even though it isn’t. This mismatch can be very disorienting.

    Example

    <!-- Not so good: says it's expanded when it's actually closed -->
    <button aria-expanded="true" onclick="toggleMenu()">Menu</button>
    
    <!-- Better: toggle the value dynamically with JavaScript -->
    <button aria-expanded="false" onclick="toggleMenu()">Menu</button>

    Make sure your script updates aria-expanded to reflect the actual state of the menu (true when open, false when closed).

    ARIA Overload

    Adding too many ARIA attributes can clutter the information that screen readers must process. For instance, overusing aria-live regions can cause screen readers to constantly read out changes that might not be important. This can frustrate users and cause them to miss critical content.

    Example

    <!-- Not so good: multiple live regions announcing frequent updates -->
    <div aria-live="polite">Update 1</div>
    <div aria-live="polite">Update 2</div>
    <div aria-live="polite">Update 3</div>
    
    <!-- Better: only announce genuinely important changes -->
    <div aria-live="polite" id="importantUpdates"></div>
    

    If you really need to announce multiple updates, try grouping them or letting users opt-in.

    Misusing aria-hidden

    aria-hidden= "true" tells screen readers to ignore an element. If you add this attribute to interactive content—like a button, form field, or link—you’re effectively locking out users who rely on assistive tech.

    Important: Hiding something visually is not always the same as hiding it from screen readers. Don’t use aria-hidden if the content is still necessary for some users.

    Example

    <!-- Not so good: Interactive element is hidden from screen readers -->
    <button aria-hidden="true" onclick="doSomething()">Buy Now</button>
    
    <!-- Better: If you need to hide it visually for some reason, do so with CSS,
         but keep it accessible to screen readers. -->
    <button class="visually-hidden" onclick="doSomething()">Buy Now</button>

    (“Visually hidden” classes typically hide elements from sighted users but keep them available to assistive tech.)

    Why “No ARIA” is Often the Best Choice

    The golden rule is this: bad ARIA is worse than no ARIA at all. Why? Because at least with no ARIA, the user experience reverts to the default behaviors of native HTML, which assistive technologies are designed to understand. But if you add incorrect ARIA roles or states, you can mislead screen readers entirely.

    In many cases, the standard HTML element does everything you need. By default, a <button> is keyboard-accessible, announces itself as a button, and can have an accessible label. Adding role= "button" to a <div> only means more overhead for you and possibly less clarity for users.

    Best Practices for Using ARIA the Right Way

    Use Native HTML First

    Always check whether you can use a built-in HTML element. This approach is simpler to code, more reliable, and better for accessibility out of the gate.

    Example

    Instead of:

    <div role="button" tabindex="0">Submit</div>

    Use:

    <button>Submit</button>

    No extra attributes, no confusion—just a straightforward button.

    Be Precise with Roles and States

    If you must use ARIA, choose the exact role that matches the purpose of your element. Also, keep an eye on the current state—like aria-expanded, aria-checked, or aria-selected—and update it only when something changes.

    Example

    <button aria-expanded="false" aria-controls="menu" onclick="toggleMenu()">Menu</button>
    <ul id= "menu" hidden>
      <li>Home</li>
      <li>Services</li>
      <li>Contact</li>
    </ul>

    In this example, setting aria-expanded= "false" on the button shows it’s not expanded. When the user clicks, you can switch that to true in your JavaScript.

    Don’t Add ARIA Where It’s Not Needed

    If an element already serves a clear function, adding a role that duplicates it is just noise for screen readers.

    Example

    <!-- Not so good -->
    <ul role="list">
      <li>Item 1</li>
      <li>Item 2</li>
    </ul>
    
    <!-- Better -->
    <ul>
      <li>Item 1</li>
      <li>Item 2</li>
    </ul>

    A <ul> is already recognized as a list by assistive technology.

    Test with Real Assistive Tech

    Tools like automated accessibility checkers are helpful, but they can’t catch everything. The best way to confirm your site’s accessibility is to test it with screen readers (like NVDA, JAWS, or VoiceOver) and try navigating entirely with a keyboard. If you can, get feedback from people who actually use these tools every day—they can point out mistakes or obstacles you might miss otherwise.

    Conclusion

    Using ARIA incorrectly can do more harm than good. In fact, it can make websites less accessible and confusing for users who rely on screen readers. The first step to building an accessible website is to stick with semantic HTML wherever possible. If you need ARIA—especially for complex custom widgets—be sure to use it carefully, accurately reflecting each element’s true roles and states. Then, test your work with real users and assistive technologies to make sure you’re making things better, not worse.

    Following these guidelines helps create a smoother experience for every visitor, including those using assistive technology. Remember: if you can solve your problem with native HTML, do that first. If not, ARIA can be a fantastic tool—just be sure you’re using it correctly.

    Need Help with Web Accessibility?

    Making a website accessible can be tricky, especially when it comes to knowing how and when to use ARIA. 216digital specializes in web accessibility, from ARIA best practices to full WCAG compliance. If you’re ready to take the next step toward a more inclusive web experience, reach out to us today! Let’s work together to ensure your site remains welcoming—and functional—for every user.

    Greg McNeil

    February 4, 2025
    How-to Guides
    Accessibility, ARIA, How-to, WCAG, Web Accessibility, web developers, web development
  • Web Accessibility: Making Drop-Down Menus User-Friendly

    Drop-down menus are a staple in website navigation, offering a compact way to organize and access multiple links. But while they streamline user experience, they can also create significant barriers if not designed with accessibility in mind. For users who rely on screen readers, keyboard navigation, or other assistive technologies, a poorly implemented menu can turn a simple browsing experience into a frustrating ordeal.

    This article will guide website owners, developers, and content creators on how to create accessible drop-down menus that enhance usability for all users. We’ll cover foundational accessibility principles, best coding practices, and testing methods to ensure your menus are inclusive and user-friendly.

    Foundational Accessibility Principles for Drop-Down Menus

    To build accessible drop-down menus, start by understanding core web accessibility principles. Here are the three most critical aspects:

    1. Use Semantic HTML

    Semantic HTML ensures that content is meaningful and properly interpreted by assistive technologies. Instead of using <div> or <span> elements for interactive components, use appropriate HTML elements like:

    • <nav> for navigation sections
    • <ul> and <li> for menu structures
    • <button> to toggle drop-down visibility

    For example:

    <nav>
      <button aria-haspopup="true" aria-expanded="false" id="menuButton">Menu</button>
      <ul id="menu" hidden>
        <li><a href="#">Home</a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Services</a></li>
        <li><a href="#">Contact</a></li>
      </ul>
    </nav>

    2. Ensure Keyboard Navigation

    Users who navigate via keyboard should be able to open, close, and move through the menu using the Tab and arrow keys. Ensure the following behaviors:

    • The menu should open with Enter or Space when focused on the toggle button.
    • The Esc key should close the menu.
    • Arrow keys should allow navigation within the menu items.

    3. Use ARIA Roles and Attributes Wisely

    ARIA (Accessible Rich Internet Applications) attributes help convey additional information to screen readers. However, improper use can create confusion. Apply ARIA roles correctly:

    • aria-haspopup="true" indicates that a button controls a drop-down menu.
    • aria-expanded="false" updates dynamically when the menu is opened or closed.
    • role="menu" and role="menuitem" clarify the structure.

    Example implementation:

    <button aria-haspopup="true" aria-expanded="false" id="menuButton">Menu</button>
    <ul id="menu" role="menu" hidden>
      <li role="menuitem"><a href="#">Home</a></li>
      <li role="menuitem"><a href="#">About</a></li>
      <li role="menuitem"><a href="#">Services</a></li>
    </ul>

    Structuring Accessible Drop-Down Menus

    Now that we’ve covered the principles, let’s implement an accessible drop-down menu using HTML, CSS, and JavaScript.

    1. Toggling Visibility

    A menu should only be visible when needed. Use JavaScript to control visibility:

    const menuButton = document.getElementById('menuButton');
    const menu = document.getElementById('menu');
    menuButton.addEventListener('click', () => {
      const expanded = menuButton.getAttribute('aria-expanded') === 'true';
      menuButton.setAttribute('aria-expanded', !expanded);
      menu.hidden = expanded;
    });

    2. Managing Focus for Keyboard Users

    When a menu opens, focus should shift inside it. When it closes, focus should return to the toggle button:

    toggle button:
    menuButton.addEventListener('click', () => {
      menu.hidden = !menu.hidden;
      menu.hidden ? menuButton.focus() : menu.querySelector('a').focus();
    });

    3. Enabling Smooth Keyboard Interactions

    To navigate the menu with arrow keys, use this approach:

    menu.addEventListener('keydown', (event) => {
      const items = [...menu.querySelectorAll('a')];
      let index = items.indexOf(document.activeElement);
      
      if (event.key === 'ArrowDown') {
        event.preventDefault();
        index = (index + 1) % items.length;
        items[index].focus();
      } else if (event.key === 'ArrowUp') {
        event.preventDefault();
        index = (index - 1 + items.length) % items.length;
        items[index].focus();
      } else if (event.key === 'Escape') {
        menu.hidden = true;
        menuButton.focus();
      }
    });

    Testing Your Drop-Down Menus for Accessibility

    1. Screen Reader Testing

    Use a screen reader like NVDA (Windows), VoiceOver (Mac), or JAWS to ensure:

    • Menus are announced properly.
    • aria-expanded updates correctly.
    • Navigation follows expected patterns.

    2. Keyboard Testing

    Try navigating your menu using only the keyboard. Ensure:

    • Tab reaches the menu.
    • Enter or Space opens the menu.
    • Arrow keys move between items.
    • Esc closes the menu.

    3. Contrast and Readability

    Ensure proper color contrast between text and background. Use tools like the WebAIM Contrast Checker to verify compliance with WCAG 2.1 standards.

    Best Practices for Creating Intuitive Menus

    • Keep It Simple: Avoid deep nesting that makes menus cumbersome.
    • Ensure Mobile Friendliness: Use larger touch targets for better usability.
    • Avoid Hover-Only Menus: They exclude keyboard users and some assistive technology users.
    • Provide Visual Indicators: Show clear changes when menus expand or collapse.

    Conclusion

    By using semantic HTML, managing focus properly, implementing ARIA roles correctly, and rigorously testing your menus, you can ensure they work for all users, regardless of ability.

    Accessible drop-down menus not only improve usability but also make your site more welcoming to all visitors. Implement these best practices today and make your navigation barrier-free!

    If you’re ready to take the next step toward digital inclusion, reach out to 216digital to schedule an ADA briefing. We’ll help you assess your website, develop a tailored plan, and guide you through the process of building an online presence that works for everyone. Don’t wait—contact us today and let’s make the internet a more accessible place together.

    Greg McNeil

    January 24, 2025
    How-to Guides
    Accessibility, drop-down menus, How-to, WCAG, Web Accessibility, web developers, web development
  • Writing Code for Web Accessibility: A Guide for Developers

    Coding often feels like speaking a secret language—it’s complex, intricate, and incredibly rewarding. Including web accessibility in your workflow isn’t about reinventing the wheel; it’s about refining your craft to ensure your work reaches everyone. Accessible code builds on the practices you already know, with small adjustments that make a significant impact. In this guide, we’ll explore actionable steps to help you create accessible, user-friendly websites that leave no user behind.

    What Is Accessible Code?

    Accessible code ensures everyone can interact with your website, regardless of ability. Following standards like the Web Content Accessibility Guidelines (WCAG) helps create an inclusive space for all users. By integrating accessibility, you’re not just meeting legal requirements but building a better, more welcoming web experience.

    Accessibility encompasses several aspects, including:

    • Visual Accessibility: Making visual content perceivable by users with visual impairments, often through tools like screen readers.
    • Interactive Usability: Ensuring interactive elements work seamlessly with keyboards, touchscreens, or voice commands.
    • Content Clarity: Structuring information logically to assist users with cognitive impairments.
    • Compatibility: Writing robust code that works with assistive technologies and adapts to future updates.

    The Four Golden Rules of Accessibility: POUR

    The foundation of accessible code is rooted in WCAG’s four guiding principles: Perceivable, Operable, Understandable, and Robust (POUR). These principles ensure your website is usable for everyone. Let’s break them down:

    • Perceivable: Users must be able to see or hear content.
      • Provide text alternatives for non-text content like images (e.g., alt text).
      • Use captions and transcripts for multimedia content.
    • Operable: Interactive elements must be usable with any input device.
      • Ensure keyboard navigation works for all features.
      • Include features like skip-to-content links to improve navigation.
    • Understandable: Content and interfaces should be easy to comprehend.
      • Label forms clearly and provide concise instructions.
      • Write meaningful error messages that guide users in resolving issues.
    • Robust: Code should be compatible with a wide range of assistive technologies.
      • Use valid, semantic HTML to ensure content is interpretable.
      • Test compatibility with assistive technologies like screen readers.

    Adhering to these principles ensures compliance with accessibility standards while enhancing usability for everyone.

    Best Practices for Writing Accessible Code

    Here’s how to apply accessibility principles to your code:

    1. Use Semantic HTML

    Semantic HTML provides structure and meaning to your content. Elements like <header>, <nav>, <main>, and <footer> improve navigation for screen readers and other assistive technologies.

    Instead of:

    <div onclick="doSomething()">Click me</div>

    Use:

    <button onclick="doSomething()">Click me</button>

    Semantic tags enhance usability and reduce the need for ARIA roles, ensuring better compatibility.

    2. Make Forms Accessible

    Forms are a common source of frustration for users with disabilities. Pair input fields with <label> tags to provide clear context:

    <label for="email">Email:</label>
    <input type="email" id="email" name="email">

    For added guidance, use aria-describedby for hints:

    <p id= "emailHint"> We'll never share your email.</p>
    <input type="email" id="email" aria-describedby="emailHint">

    Additionally:

    • Group related fields with <fieldset> and <legend>.
    • Include real-time error validation with accessible alerts.

    3. Ensure Keyboard Navigation

    Interactive elements should be operable using a keyboard. Use logical HTML structures and the tabindex attribute sparingly to create a natural focus order.

    Example:

    <button tabindex="0">Focus me</button>

    Avoid negative tabindex values unless necessary, as they can disrupt navigation.

    4. Add Alt Text to Images

    Alt text makes images accessible to screen readers. Describe the content succinctly:

    <img src= "puppy.jpg" alt= "A golden retriever puppy playing with a ball">

    If an image is decorative, use an empty alt attribute (alt= "") to skip it for screen readers.

    5. Mind Your Colors

    Color contrast impacts readability. Use tools like Contrast Checker to verify that text is legible. Avoid using color as the sole means of conveying information. For example:

    <span style="color: red;">Required field</span>

    Should also include:

    <span class="required" aria-label="Required field">*</span>

    6. Use ARIA Wisely

    Accessible Rich Internet Applications (ARIA) roles can enhance functionality but should be used sparingly. Stick to semantic HTML whenever possible. Common ARIA roles include:

    • role= "alert" for dynamic notifications.
    • aria-expanded for collapsible menus.
    • aria-live for real-time updates.

    7. Don’t Forget Multimedia

    Provide captions for videos and transcripts for audio content. Respect user preferences for reduced motion by using the prefers-reduced-motion media query:

    @media (prefers-reduced-motion: reduce) {
      animation: none;
    }

    Testing Your Accessible Code

    Even the best code needs testing. Use these methods:

    • Automated Testing: Tools like Google Lighthouse or WAVE can identify common issues.
    • Manual Testing: Navigate your site using only a keyboard or a screen reader (e.g., NVDA, VoiceOver).
    • User Testing: Get feedback from users with disabilities to uncover real-world issues.

    Testing should be an ongoing part of your development process to catch and fix issues early.

    Challenges Developers Face—and How to Overcome Them

    Challenge: Understanding WCAG Guidelines Can Be Intimidating

    Solution: Start with the essentials. Focus on foundational elements like semantic HTML, alt text, and keyboard navigation. Once these are second nature, dive deeper into more complex guidelines—one step at a time.

    Challenge: Debugging ARIA Roles Can Be Tricky

    Solution: ARIA can feel like uncharted territory, but tools like ARIA Authoring Practices and automated testing tools (e.g., Google Lighthouse or WAVE) make it manageable. Stick to semantic HTML where possible to minimize the need for custom roles.

    Challenge: Maintaining Accessibility During Updates

    Solution: Accessibility isn’t a one-and-done task; it’s an ongoing commitment. Make accessibility checks part of your QA process and leverage tools like WAVE to identify issues after every update. Document accessibility practices in your team’s workflow to keep everyone aligned.

    Challenge: Balancing Deadlines with Accessibility Goals

    Solution: Tight deadlines can pressure teams to deprioritize accessibility. Combat this by integrating accessibility from the start of a project rather than treating it as an add-on. Small, consistent efforts save time in the long run and prevent last-minute fixes.

    By acknowledging these challenges and embracing practical solutions, developers can turn obstacles into opportunities to create better, more inclusive websites.

    Keep Learning and Building Accessible Code

    Web accessibility is a continuous journey—and an exciting one. As developers, we thrive on solving problems and improving our craft, and accessibility is no different. By staying updated with trusted resources like WebAIM, MDN Web Docs, and the A11y Project, you can keep sharpening your skills and pushing the boundaries of what’s possible. Engage with communities, take courses, and embrace every opportunity to learn. Every small step you take makes the web a more inclusive place for everyone.

    Writing accessible code is about thoughtful, inclusive choices that enhance user experiences. Start with the basics, make accessibility an integral part of your workflow, and let learning drive your improvements. The impact of your efforts extends far beyond compliance; it creates meaningful connections and opens your work to all users, regardless of ability.

    Ready to take your commitment further? Schedule an ADA briefing with 216digital. Our team specializes in tailored web accessibility solutions, helping you mitigate risks and create a more inclusive online presence. Let’s build a better web—together.

    Greg McNeil

    January 9, 2025
    How-to Guides
    accessible code, ADA Compliance, How-to, WCAG, web developers, web development
  • Making Hidden Content Accessible to Assistive Technologies

    As a web developer, you want your website to be usable by everyone, including people who rely on assistive technologies. These technologies—such as screen readers, braille displays, and speech recognition software—can help individuals with disabilities navigate the web more easily. Sometimes, you may need to hide certain parts of your webpage visually without hiding them from these tools. However, doing this incorrectly can cause big accessibility issues.

    In this article, we’ll explore how to effectively hide and manage hidden content for people using assistive technologies. We’ll discuss why display: none is problematic, how to use the clip pattern, and how attributes like aria-hidden and hidden can help. By the end, you’ll have a better understanding of how to ensure your website remains inclusive and user-friendly.

    The Problem with display: none

    When you use display: none in your CSS, you remove an element from the visual flow of the page. This means sighted users will not see it. But, it also means the element is completely invisible to assistive technologies such as screen readers. If you’ve hidden important text or controls this way, users who rely on assistive technologies might miss out on content or functionality that they need.

    For example, imagine you have a button that visually looks like an icon, but you hide the text label using display: none. Now, people who can see the icon know what the button does, but people using assistive technologies hear nothing. This creates a poor user experience and makes your site less accessible.

    The Clip Pattern: A Better Approach

    To visually hide content while keeping it available to assistive technologies, the clip pattern is a popular solution. The idea is to position the element off-screen so sighted users don’t see it, but screen readers can still find it. Here’s an example:

    .visually-hidden {
      position: absolute;
      width: 1px;
      height: 1px;
      margin: -1px;
      padding: 0;
      border: 0;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
    }

    By applying the .visually-hidden class to your element, you ensure it’s hidden visually but remains accessible to assistive technologies. This makes the content discoverable by screen readers, letting users who can’t see the screen still benefit from it.

    Why the Clip Pattern Works

    This pattern relies on moving the element so it’s not visible in the viewport and restricting its size to 1px by 1px. With clip: rect(0, 0, 0, 0); (or clip-path in modern CSS), the browser cuts off any visual display. Yet, the element remains in the Document Object Model (DOM), meaning assistive technologies can still access it. That’s the key difference between this and display: none.

    Managing Visibility with aria-hidden and the hidden Attribute

    Beyond CSS, there are HTML and ARIA (Accessible Rich Internet Applications) attributes that also control how content is shown to both users and assistive technologies. Two important attributes here are aria-hidden and the HTML5 hidden attribute.

    aria-hidden="true"

    When you add aria-hidden="true" to an element, you’re telling assistive technologies not to read or announce that element to users. This is handy for decorative images or redundant content. For instance, if you have a background image that doesn’t provide important information, you could mark it with aria-hidden="true" so screen readers ignore it.

    But be cautious: if you need an element to be read by assistive technologies, do not use aria-hidden=”true”. This attribute will block that element from being announced entirely.

    <div aria-hidden="true">
      <img src="decorative-image.jpg" alt=""/>
    </div>

    HTML5 hidden Attribute

    The hidden attribute is another way to remove content from everyone—both sighted users and assistive technologies. When you use it, browsers typically hide the element. Screen readers will also skip it. This is good if the element is meant to be inaccessible to all users, like a form section that’s not yet relevant or a menu item that’s not available.

    <div hidden>
      <p>This content is hidden from all users.</p>
    </div>

    Use hidden or aria-hidden when you truly want to exclude an element from assistive technologies. If you want it hidden visually but still available to screen readers, you should stick with the clip pattern or .visually-hidden approach.

    Best Practices for Accessible, Visually-Hidden Content

    1. Use Semantic HTML

    Using proper semantic HTML elements (like <nav> for navigation, <main> for main content, or <section> for thematic grouping) is important for clear structure. It helps assistive technologies interpret your content correctly. Semantic HTML also reduces the need for extra attributes and complex styling, since the markup itself conveys meaning.

    2. Avoid Hiding Focusable Elements

    If an element can receive focus (like links, form inputs, or buttons), think carefully before hiding it. A hidden yet focusable element can be confusing for keyboard-only users, since it might get focus without being visible. If you must hide a focusable element, consider removing it from the tab order by using tabindex="-1" or ensuring it’s properly revealed at the right time.

    For example, if you have a pop-up form that appears only after a button click, you can initially hide it with the clip pattern. Once the user clicks, you can remove the clip pattern or switch the CSS to show the content. This way, the form becomes available to both sighted users and people using assistive technologies at the same time.

    3. Provide Context for Hidden Content

    Sometimes you want to reveal hidden content dynamically (like a drop-down menu). In these cases, use ARIA attributes such as aria-expanded and aria-controls to inform assistive technologies that a certain part of the page is now visible or hidden. This can help screen reader users understand changes on the page.

    <button aria-expanded="false" aria-controls="menu" id="menuButton">
      Toggle Menu
    </button>
    
    <nav id="menu" class="visually-hidden">
      <!-- Menu items go here -->
    </nav>

    When you click the button, you can toggle its aria-expanded value from false to true, and remove the .visually-hidden class from the menu. This ensures that both visual and non-visual users know the content has been revealed.

    4. Test with Multiple Assistive Technologies

    It’s important to test your website with different assistive technologies because each one may behave slightly differently. Popular screen readers include NVDA, JAWS, and VoiceOver. Don’t forget to check on both desktop and mobile devices. Regular testing can help you catch accessibility issues before your users do.

    Handling Localization

    If you’re translating your site into multiple languages, remember that hidden text might also need translation. For example, your .visually-hidden text for instructions or links should be available to screen readers in every supported language. Make sure your language attributes (like lang="en") are correct, and consider cultural differences that could impact how you label hidden elements.

    For instance, if you have an English site and a Spanish site, your hidden instructions should be translated into Spanish on the Spanish version. This ensures that users relying on assistive technologies can access the content in the correct language.

    Putting It All Together: A Quick Example

    Let’s look at a simple example of an accessible button that has visually hidden text:

    <button class="icon-button">
      <span class="visually-hidden">Submit Form</span>
      <img src="icon-submit.png" alt="" aria-hidden="true" />
    </button>
    • The .visually-hidden class hides the text “Submit Form” from sighted users, but screen readers can still read it.
    • The <img> tag includes an empty alt attribute and aria-hidden="true", so assistive technologies ignore the image itself.
    • Sighted users see only the icon, while screen reader users hear “Submit Form.”

    This example keeps your content accessible to people using assistive technologies and also meets visual design needs.

    Additional Resources

    • Web Content Accessibility Guidelines (WCAG): A detailed guide on making web content accessible.
    • WAI-ARIA Authoring Practices: Official tips on using ARIA roles, states, and properties.
    • MDN Web Docs on ARIA: In-depth explanations of ARIA attributes and best practices.

    Exploring these resources will help you master hiding content effectively, ensuring people who use assistive technologies can still access everything they need.

    Conclusion

    Hiding content from sighted users while keeping it accessible to assistive technologies is an essential skill for modern web developers. By avoiding display: none for important information, using the clip pattern for visually hidden content, and carefully leveraging aria-hidden or hidden, you can ensure everyone has a good experience on your site.

    Remember to keep the following points in mind:

    1. Use the clip pattern (.visually-hidden) to hide content from sighted users but keep it readable by assistive technologies.
    2. Use aria-hidden and hidden only when you truly want to hide content from all users, including those using assistive technologies.
    3. Pay attention to focusable elements, making sure you don’t accidentally trap keyboard users in hidden sections.
    4. Test frequently with various tools and real users to ensure your hidden content behaves as you expect.
    5. Localize your hidden text so that people using assistive technologies in other languages can also benefit.

    By following these guidelines, you’ll be well on your way to building inclusive websites that work for everyone. Your careful attention to accessibility shows that you value all your users, regardless of their abilities or the assistive technologies they use. Embracing these practices will help ensure a positive, welcoming, and user-friendly experience across the board.

    Greg McNeil

    December 31, 2024
    How-to Guides
    Accessibility, assistive technology, How-to, web developers, web development, Website Accessibility
  • How to Make Data Tables Accessible

    Data tables are a powerful way to present structured information, but without proper attention to accessibility, they can exclude users with disabilities. Whether you’re a developer, content creator, or website owner, learning how to make your tables user-friendly for everyone is an essential skill.

    Accessibility standards like WCAG (Web Content Accessibility Guidelines) provide the foundation for creating inclusive data tables. By following best practices such as structuring your tables properly, adding meaningful headers, and ensuring compatibility with assistive technologies, you can enhance usability while meeting legal and ethical standards.

    Understanding the Basics of Accessible Tables

    Before diving into the specifics, it’s important to understand what makes a table accessible. Accessible tables are designed to be navigable and understandable by all users, including those who rely on screen readers or keyboard navigation. This means paying attention to the structure, design, and additional information like captions and summaries.

    The foundation of an accessible table lies in its structure. HTML provides semantic elements like <table>, <thead>, <tbody>, and <th> to organize your data logically. Using these elements correctly ensures that assistive technologies can interpret the table properly. For example, headers defined with <th> tags allow screen readers to associate data cells with their corresponding column or row, creating a more intuitive experience for users.

    Adding Headers, Captions, and Summaries

    Headers are one of the most critical components of an accessible table. They guide users in understanding what each data point represents. To define headers, use the <th> element, and consider including the scope attribute to indicate whether the header applies to a column, row, or group of columns and rows. For example, <th scope="col"> signals that the header applies to an entire column, while <th scope="row"> applies to a row.

    Captions and summaries provide additional context for your table. A caption, placed within the <caption> tag, serves as a brief title or description of the table’s purpose. Summaries, while not an HTML element, can be included to provide a detailed explanation of the table’s content, especially if it’s complex. This can be added through the <summary> attribute or as part of surrounding content. These elements are particularly valuable for screen reader users, offering them a quick overview of what to expect.

    Ensuring Compatibility with Screen Readers

    Screen readers rely on well-structured and semantically correct HTML to interpret tables. To optimize compatibility, avoid using tables for layout purposes. While this practice was common in the past, it confuses screen readers by mixing presentational and data tables. Instead, use CSS for layout and reserve tables strictly for data.

    Another crucial consideration is avoiding merged cells unless absolutely necessary. While colspan and rowspan attributes can be used to merge cells, they can make navigation more challenging for screen reader users. If your table requires merged cells, ensure that the relationships between headers and data are clearly defined with attributes like headers and id.

    Making Tables Keyboard-Friendly

    Keyboard accessibility is vital for users who cannot use a mouse. Accessible tables should allow users to navigate logically through rows and columns using only their keyboard. Test your table to ensure that tabbing through the data follows a predictable order.

    One way to achieve this is by maintaining a logical document flow. Keep your table simple and organized to prevent users from getting lost. If the table is part of a larger webpage, include clear instructions and use skip links to help users bypass unrelated content.

    Simplifying Complex Tables

    Complex tables with nested headers or multi-level data can be difficult to navigate, even for experienced users. Simplifying these tables can go a long way toward improving accessibility. Consider breaking down large, complicated tables into smaller, more manageable ones. You can also use additional tools like expandable rows or columns to provide details without overwhelming the user.

    For situations where simplifying isn’t feasible, invest extra effort in defining relationships between headers and data. Use the headers and id attributes to explicitly associate each cell with its relevant headers. This ensures that screen readers can convey the relationships accurately, even in intricate tables.

    Improving Readability with Responsive Design and Contrast

    Accessibility isn’t just about assistive technologies—it’s also about making content visually readable for users with low vision or cognitive challenges. Responsive design is essential for ensuring that your tables are accessible across devices. Use CSS to make your tables adapt to different screen sizes without losing clarity or functionality.

    High contrast is another key factor. Choose colors that provide sufficient contrast between text and background. WCAG recommends a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text. Tools like WebAIM’s Contrast Checker can help you verify compliance.

    Testing Your Tables for Accessibility

    No matter how carefully you design your tables, testing is essential to identify and address potential issues. Start by using automated tools like the WAVE Web Accessibility Evaluation Tool to check for common errors. While these tools are helpful, they can’t catch everything, so manual testing is equally important.

    Test your table using a screen reader like NVDA or JAWS to experience it as a user with visual impairments would. Pay attention to how headers, captions, and data are announced. Does the screen reader navigate the table logically? Are all elements correctly identified and described?

    Keyboard testing is another critical step. Navigate through the table using only your keyboard to ensure that all interactive elements are accessible and functional.

    Why Accessible Tables Matter

    Accessible tables aren’t just about meeting legal requirements—they’re about creating a better user experience for everyone. By making your data tables accessible, you’re opening your content to a wider audience, including individuals with disabilities who rely on assistive technologies.

    Moreover, accessibility enhances usability for all users, not just those with disabilities. Features like clear headers, logical navigation, and responsive design make tables easier to use for everyone, whether they’re on a desktop computer or a smartphone.

    Conclusion

    Creating accessible data tables might require extra effort, but the benefits are well worth it. By following best practices like using proper structure, adding descriptive headers and captions, and ensuring compatibility with assistive technologies, you can make your tables both compliant and user-friendly.

    Remember, accessibility is an ongoing process. Stay informed about updates to guidelines like WCAG and continuously test your content to ensure it meets the highest standards. By prioritizing accessibility, you’re not just improving your website—you’re making the web a more inclusive space for all.

    Ready to take the first step? Partner with the experts at 216digital, who understand accessibility inside and out. Together, we can create a web that works for everyone—and protect your business in the process. Schedule your complimentary ADA briefing today to start your journey toward an accessible and compliant future.

    Greg McNeil

    December 11, 2024
    How-to Guides
    Accessibility, Data tables, How-to, web developers, web development, Website Accessibility
Previous Page
1 2 3 4 5
Next Page
216digital Scanning Tool

Audit Your Website for Free

Find Out if Your Website is WCAG & ADA Compliant













    216digital Logo

    Our team is full of expert professionals in Web Accessibility Remediation, eCommerce Design & Development, and Marketing – ready to help you reach your goals and thrive in a competitive marketplace. 

    216 Digital, Inc. BBB Business Review

    Get in Touch

    2208 E Enterprise Pkwy
    Twinsburg, OH 44087
    216.505.4400
    info@216digital.com

    Support

    Support Desk
    Acceptable Use Policy
    Accessibility Policy
    Privacy Policy

    Web Accessibility

    Settlement & Risk Mitigation
    WCAG 2.1/2.2 AA Compliance
    Monitoring Service by a11y.Radar

    Development & Marketing

    eCommerce Development
    PPC Marketing
    Professional SEO

    About

    About Us
    Contact

    Copyright 2024 216digital. All Rights Reserved.