Accessibility for AI Coders | SheCodes
Intermediate 5 min read

Accessibility Guide for AI Coders

Make your website usable by everyone, including people with disabilities. Good accessibility is good design, and your AI tool can handle most of it for you.

In this chapter

  • What web accessibility means and why it matters for everyone
  • How to ask AI to build accessible sites from the start
  • Simple ways to test your site with a keyboard or screen reader
  • Plain-English explanations of contrast, alt text, and ARIA labels

Why Accessibility Matters

👥 1 in 4 adults have a disability Visual, motor, cognitive, or hearing disabilities affect how people use the web.
⚖️ Legal requirements Many countries require websites to be accessible. ADA, WCAG, and EAA compliance.
🚀 Better for everyone Accessible sites have better SEO, performance, and user experience for all users.

Use the Right Building Blocks

Websites are made of building blocks: buttons, links, headings, lists, and more. When the right blocks are used, screen readers (software that reads websites aloud for blind users) can understand your page. When the wrong ones are used, things break for people with disabilities.

🔘 Use real buttons for clickable things If something performs an action (like submitting a form, opening a menu, or toggling something on/off), it should be a real button. Screen readers announce it as a button, and keyboard users can press it with the Enter or Space key.
Tell your AI tool:

“Make sure all clickable elements that perform actions are real buttons, not just styled text or containers.”

🔗 Use real links for navigation If clicking something takes the user to a new page or a different section, it should be a real link. This lets screen readers announce it as a link and lets users open it in a new tab.
Tell your AI tool:

“Make sure all navigation elements that go to other pages or sections are real links, not just styled text.”

📑 Use real headings for titles Headings create an invisible outline of your page. Screen reader users jump between headings to scan your content, just like sighted users scan for bold titles. Use them in order: one main title, then subtitles, then sub-subtitles.
Tell your AI tool:

“Make sure the page has a clear heading hierarchy: one h1 for the main title, h2 for sections, h3 for subsections. Don't skip levels.”

📋 Use real lists for groups of items When you have a group of related items (like features, steps, or menu options), a real list tells screen readers how many items there are and lets users navigate between them.
Tell your AI tool:

“Use proper list elements for any group of related items instead of just stacking text.”

🏗️ Use page sections for structure Every page should have clear areas: a header at the top, a navigation menu, a main content area, and a footer at the bottom. Screen reader users rely on these landmarks to jump around the page quickly.
Tell your AI tool:

“Make sure the page has proper landmark regions: a header, nav, main content area, and footer.”

📝 Use real form labels Every text field, dropdown, and checkbox needs a visible label that is properly connected to it. This way, screen readers tell users what each field is for, and clicking the label focuses the field.
Tell your AI tool:

“Make sure every form input has a visible label element properly connected to it. Don't rely on placeholder text alone.”

Extra Labels for Screen Readers

Sometimes a button has an icon but no visible text, or a section of your page updates without reloading. In these cases, you need to add invisible labels that screen readers can announce. Your AI tool knows how to do this. You just need to ask.

Icon-only buttons A close button that just shows an X, or a search button that just shows a magnifying glass
Tell your AI tool:

“Add descriptive labels to all icon-only buttons so screen readers can announce what they do.”

Decorative images Background patterns, dividers, or purely visual flourishes that don't add meaning
Tell your AI tool:

“Hide all decorative images from screen readers. Only images that convey information should have descriptions.”

Dropdown menus and accordions A FAQ section that expands and collapses, or a mobile hamburger menu
Tell your AI tool:

“Make sure dropdown menus and accordions announce whether they are open or closed to screen readers.”

Live updates A notification count that changes, a chat message that appears, or a form error that shows up
Tell your AI tool:

“Make sure dynamic content changes (like notifications, alerts, and error messages) are announced to screen readers.”

Complex widgets Tabs, sliders, date pickers, or custom components that don't use standard elements
Tell your AI tool:

“Add proper accessibility roles and labels to all custom widgets so screen readers understand what they are and how to use them.”

Linked descriptions A password field with a hint below it that says 'Must be at least 8 characters'
Tell your AI tool:

“Connect help text and descriptions to their related form fields so screen readers read them together.”

Color Contrast

If your text color is too similar to the background color, people with low vision can't read it. This is one of the most common accessibility problems, and one of the easiest to fix.

Live example
How to check your colors
Use this free tool to check if your text is readable:
WebAIM Contrast Checker
Go to webaim.org/resources/contrastchecker, paste in your text color and background color, and it tells you if the contrast is good enough.
Quick rules of thumb
Dark text on light backgrounds (or light text on dark backgrounds) is almost always fine
Light gray text on white backgrounds is the most common problem: make your grays darker
Don't rely on color alone to show something is important: add an icon or bold text too
If you use colored status indicators (like red for error), also add a label or icon
Tell your AI tool:

“Check that all text on this page has enough contrast against its background to be readable. Fix any low-contrast text.”

Keyboard Navigation

Many people can't use a mouse. They navigate entirely with a keyboard using the Tab key to jump between buttons, links, and form fields. Your site needs to work for them too.

Live example
Things to ask your AI tool to check
Can you reach every button, link, and form field by pressing Tab? (If not, something is broken.)
Can you always see which element is currently selected? (There should be a visible outline or highlight.)
Does the Tab order make sense? (It should follow the visual layout: top to bottom, left to right.)
Can you open and close menus, modals, and dropdowns with just the keyboard?
When a modal or popup opens, does focus move into it? When it closes, does focus go back to where you were?
Is there a 'Skip to content' link that lets keyboard users jump past the navigation menu?
Tell your AI tool:

“Make sure the entire site is navigable by keyboard. All interactive elements should be reachable with Tab, have visible focus indicators, and follow a logical order. Add a skip-to-content link at the top of the page.”

Quick Accessibility Checklist

Copy this list and ask your AI tool to go through each item on your site.

  • Every image has a text description (so screen readers can explain what it shows)
  • Text is easy to read against the background (good contrast)
  • Every button, link, and form field can be reached and used with just a keyboard
  • When you Tab to something, you can see which element is selected
  • Every form field has a label that explains what to type
  • The page has one main title, followed by section titles in order
  • Error messages explain what went wrong and appear next to the right field
  • Links say where they go (not just 'click here')
  • Videos have captions or a written transcript
  • Animations can be turned off for people who find motion uncomfortable
  • Color is never the only way something is communicated: icons or text back it up
Tell your AI tool:

“Review my site for accessibility issues. Check images for alt text, color contrast, keyboard navigation, heading hierarchy, form labels, and link text. Fix anything that doesn't meet WCAG 2.1 AA standards.”

Prompts to Make Your Site Accessible

Copy and paste these into your AI tool to fix common accessibility issues.

Full audit

“Do a complete accessibility audit of this page. Check for proper heading structure, alt text on images, keyboard navigation, color contrast, form labels, and screen reader support. Fix everything you find.”

Images

“Add descriptive alt text to every image that conveys information. For purely decorative images (like background patterns), hide them from screen readers.”

Forms

“Make sure every form field has a visible label, error messages are clear and connected to the right field, and the entire form works with just a keyboard.”

Navigation

“Add a skip-to-content link at the top of the page. Make sure the navigation menu is fully keyboard accessible and has proper labels for screen readers.”

Animations

“Add support for reduced motion. If the user has turned on 'reduce motion' in their device settings, turn off or simplify all animations.”

Testing

“Walk me through how to manually test this page for accessibility using just my keyboard and browser. Tell me what to press and what to look for.”

Prompt This

Copy-paste these prompts into your AI tool to apply what you just learned.

FULL ACCESSIBILITY AUDIT

“Audit my page for accessibility issues. Check for missing alt text, poor contrast, keyboard navigation, proper heading hierarchy, and ARIA labels. Fix everything you find.”

MAKE A COMPONENT ACCESSIBLE

“Make my [form/navigation/modal] fully accessible. Add proper labels, keyboard support, focus management, and screen reader announcements.”

Frequently Asked Questions

Do I need to worry about accessibility if my site is just for friends or a small audience?

Yes! Accessibility helps everyone, not just people with permanent disabilities. Someone might be using your site on a phone in bright sunlight, with a broken mouse, or while holding a baby. Good accessibility just means your site works well in more situations.

Will accessibility make my site look ugly?

Not at all. Accessibility is mostly invisible: it's about structure, labels, and keyboard support. The only visible changes are things like readable text contrast and visible focus outlines, which actually make your site look more polished.

Can my AI tool handle all of this for me?

AI tools are great at building accessible code from the start. The key is to ask for it upfront: include 'make this accessible' in your prompts. It's much easier than fixing things later.

How do I test if my site is accessible?

Try using your site with just your keyboard (no mouse). Can you reach everything? Can you see what's focused? You can also install the free WAVE browser extension (wave.webaim.org) which highlights issues directly on your page.

What is WCAG?

WCAG stands for Web Content Accessibility Guidelines. It's the international standard for web accessibility. When someone says 'WCAG 2.1 AA,' they mean the most commonly required level of compliance. You don't need to memorize it. Just tell your AI tool to follow WCAG 2.1 AA standards.

What's a screen reader?

A screen reader is software that reads a website out loud for people who can't see the screen. It reads headings, buttons, links, and images (using their text descriptions). When your site uses the right building blocks, screen readers can navigate it easily.