How to make your site keyboard accessible
WCAG: 2.1.1 Keyboard, 2.4.3 Focus Order, 2.4.7 Focus Visible ยท Updated October 14, 2026
Many people cannot use a mouse: people with motor disabilities, screen reader users, and power users. Most keyboard problems can only be found by trying, so this guide starts with a two-minute test.
The two-minute test
- Click the address bar, then press Tab repeatedly.
- Can you always see where focus is?
- Does focus move in a logical order?
- Can you open the menu, use dropdowns, close pop-ups with Esc, and submit forms with Enter or Space?
- Does focus ever get stuck?
Common fixes
- Invisible focus. Never remove outlines without a replacement:
:focus-visible { outline: 3px solid #0060c7; outline-offset: 3px; } - Clickable divs. Replace
<div onclick>with<button>or<a href>. - Hidden but focusable. Off-screen menus and closed modals must not be reachable by Tab. Use
hidden,inert, ordisplay:none. - Scrollable boxes. Add
tabindex="0"and a label to scrollable regions. - Positive tabindex. Avoid
tabindex="1"and higher; it scrambles the order.
Step by step
- Tab through the page. Use only the keyboard and watch the focus indicator.
- Restore focus styles. Add a visible :focus-visible style.
- Use native controls. Replace clickable divs with buttons and links.
- Remove hidden focus. Make closed menus and modals unreachable by Tab.
Check your page. Run a free scan to see which of these issues it finds.
Automated accessibility scan. Results are informational and may not identify every accessibility issue. This service is not legal advice, a compliance certification, or a substitute for comprehensive manual accessibility testing.