Lorixen.
EN

Keyboard navigation and skip links: a quick fix list

Short answer: Put your mouse aside and press Tab through your homepage, a service page and your contact form. Every link, button and field should be reachable in a sensible order, the focused element should always be clearly visible, and a "Skip to main content" link should appear first so keyboard users can jump past the menu. Most fixes are small: restore a removed focus outline, add the skip link, replace clickable <div>s with real buttons and stop menus or pop-ups trapping focus.

Plenty of people navigate websites without a mouse: people with motor impairments, screen reader users, power users and anyone with a broken trackpad. Keyboard access also underpins much of what assistive technologies rely on. This guide is a practical test-and-fix list for a typical small business site.

Step 1: run the five-minute keyboard test

  1. Open your homepage and click in the browser's address bar.
  2. Press Tab repeatedly. Watch where focus goes.
  3. Press Shift+Tab to go backwards.
  4. Use Enter to follow links and press buttons, Space for buttons and checkboxes, arrow keys in menus and radio groups, and Esc to close dialogs.
  5. Repeat on a key page: contact or booking form, product page, checkout.

Write down every moment where you can't see focus, can't reach something, get stuck, or jump somewhere unexpected.

Step 2: make focus visible

Symptom: you press Tab and can't tell what's selected.

Cause: web.dev's accessibility course on focus explains that themes often override the browser's default focus indicator with outline: 0 or outline: none, which makes it very difficult for keyboard users to see where they are.

Fix: remove those overrides or replace them with a clear custom style. MDN documents the :focus-visible pseudo-class, which applies when the browser judges that focus should be made evident, typically for keyboard navigation, letting you show a strong focus ring for keyboard users without showing it on every mouse click. A thick outline in a colour that contrasts with both the element and the background works well.

Symptom: on every page, keyboard users must tab through the logo, every menu item and maybe a search box before reaching the content.

Fix: web.dev describes skip links for exactly this problem: most sites have a long list of header menu links, consistent from page to page, which is great for navigation but slow for keyboard users. A skip link is the first focusable element on the page, linking to the main content area:

  • Place it as the very first link inside <body>.
  • Point it at your main content, for example <a href="#main">Skip to main content</a> with id="main" on the <main> element.
  • It can be visually hidden until focused, then appear clearly at the top of the screen.
  • Test that pressing Enter actually moves focus to the content, not just scrolls.

Step 4: fix the focus order

Symptom: focus jumps around: footer before content, or a pop-up's button reached only after the whole page.

Causes and fixes:

  • Positive tabindex values. MDN recommends using only 0 and -1 as tabindex values and avoiding values greater than zero, as well as CSS that reorders focusable elements visually. web.dev adds that circumstances rarely warrant a positive tabindex. Remove them and let the document order define focus order.
  • Layout that doesn't match the source order. If CSS moves things around visually, the keyboard still follows the HTML. Reorder the HTML so it matches the visual order.

Step 5: make everything interactive reachable

Symptom: some "buttons" can't be reached or activated with the keyboard.

Cause: clickable <div> or <span> elements with JavaScript click handlers. web.dev notes that naturally focusable elements such as links, checkboxes and inputs come with built-in tab order and basic keyboard handling.

Fix: use a real <button> for actions and <a href> for navigation. If a custom element is unavoidable, it needs tabindex="0", an appropriate role and keyboard handling, which is more work than using the native element.

Step 6: check menus, dropdowns and pop-ups

  • Dropdown menus: can you open submenus with the keyboard, move through them and close them? Hover-only menus fail.
  • Dialogs and pop-ups: when one opens, focus should move into it; Tab should stay inside it while it's open; Esc should close it; and focus should return to the button that opened it.
  • Cookie banners and newsletter pop-ups: a common trap. Make sure they can be dismissed with the keyboard and don't block focus elsewhere.
  • Carousels: controls must be focusable, and auto-rotating content shouldn't steal focus.

Step 7: check forms

  • Every field has a visible label connected to it.
  • Error messages are reachable and announced, and focus goes to the first error or a summary after a failed submission.
  • Date pickers and custom selects work with the keyboard, or a plain text alternative is offered.
  • The submit button is a real button.

Step 8: embedded tools

Booking widgets, chat widgets, maps and payment forms from third parties are frequent problem areas. Test them too. If a vendor's widget traps focus or can't be used by keyboard, report it to the vendor and consider offering an alternative route, such as a phone number or simple form.

Keep it fixed

  • Add the keyboard test to your checklist for every redesign, new plugin or new widget.
  • Ask your developer to avoid removing focus styles in the theme.
  • Re-test after theme updates.

FAQ

What is a skip link?

A link at the very top of the page, usually hidden until focused, that lets keyboard users jump straight to the main content instead of tabbing through the menu on every page.

Is it okay to hide the focus outline because it looks ugly?

Not without replacing it. Restyle it to fit your brand, using :focus-visible if you only want it for keyboard users, but keep a clearly visible indicator.

Do I need a developer for these fixes?

Some are simple theme or CSS changes. Menus, dialogs and custom widgets usually need a developer, especially if the theme builds them with non-native elements.

Is keyboard testing enough to check accessibility?

It's an essential start but not the whole picture. Colour contrast, headings, alt text and screen reader behaviour need checking too.

Tried tabbing through your site and got lost halfway down the menu? Tell us where it went wrong and we'll help you fix the focus problems.

Sources

WhatsAppLet’s talk