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
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.
“Make sure all clickable elements that perform actions are real buttons, not just styled text or containers.”
“Make sure all navigation elements that go to other pages or sections are real links, not just styled text.”
“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 proper list elements for any group of related items instead of just stacking text.”
“Make sure the page has proper landmark regions: a header, nav, main content area, and footer.”
“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.
“Add descriptive labels to all icon-only buttons so screen readers can announce what they do.”
“Hide all decorative images from screen readers. Only images that convey information should have descriptions.”
“Make sure dropdown menus and accordions announce whether they are open or closed to screen readers.”
“Make sure dynamic content changes (like notifications, alerts, and error messages) are announced to screen readers.”
“Add proper accessibility roles and labels to all custom widgets so screen readers understand what they are and how to use them.”
“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.
“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.
“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
“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.
“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.”
“Add descriptive alt text to every image that conveys information. For purely decorative images (like background patterns), hide them from screen readers.”
“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.”
“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.”
“Add support for reduced motion. If the user has turned on 'reduce motion' in their device settings, turn off or simplify all animations.”
“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.
“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 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.