All posts
·8 min read·accessibility · keyboard navigation · wcag

Put the mouse away: skip links, focus outlines and tab order on your homepage

A two-minute keyboard accessibility test for your homepage: what the Tab key reveals about skip links, focus outlines, tab order and menu buttons, plus the fix for each.

Most people who own a website have never used it without a mouse. That is the whole problem with keyboard accessibility: the failures are invisible until you put the mouse away, and then they are impossible to miss. People with motor disabilities use a keyboard or switch device, screen reader users drive everything from the keyboard, and plenty of others simply prefer Tab and Enter.

The test takes two minutes, needs no tools, and most fixes are a line or two of code. Open your homepage in a desktop browser, push the mouse out of reach, and follow along.

The two-minute keyboard accessibility test

Click once in the browser's address bar, then press Tab. Focus moves into the page. Keep pressing Tab and watch where it goes. Shift+Tab steps backward, Enter follows a link or presses a button, and Escape should close anything that opened.

You are watching for four things:

  1. How many presses it takes to reach your main content
  2. Whether you can always see which element has focus
  3. Whether focus moves through the page in the order you read it
  4. Whether the mobile menu button opens, closes, and reports what it did

On a typical small business homepage, at least one of these goes wrong. Here is what each failure looks like and the one change that fixes it.

Thirty presses before the headline: the missing skip link

What you will see: the first press lands on the logo. Then the phone number, the "Book now" button, every top-level menu item, often every dropdown item, the search icon and the social icons. A header with twenty or thirty links is normal. A keyboard user has to step through all of them on every page load before reaching the headline they came for.

The fix is a skip link: the first focusable element on the page, hidden until it receives focus, that jumps straight to the main content.

<a class="skip-link" href="#main-content">Skip to main content</a>
<!-- header and menu -->
<main id="main-content" tabindex="-1">
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 1000; }

Run the test again. The first Tab should now reveal "Skip to main content," and pressing Enter should put your next Tab inside the page body. This satisfies WCAG success criterion 2.4.1, Bypass Blocks. Many themes ship with a skip link already, so check that yours points to an id that still exists on the page. A skip link aimed at a missing target does nothing.

Focus that vanishes: the removed outline

What you will see: you press Tab and nothing visible changes. Or the ring shows on the first few links, then disappears inside the menu or on your buttons. You are moving through the page blind, and so is every keyboard visitor.

The cause is almost always one declaration: outline: none or outline: 0. Designers remove the focus ring because it looked out of place when someone clicked a button with a mouse. Themes and page builders do it too, sometimes as an inline style attribute on individual buttons, where it is harder to find and override.

The fix is to stop choosing between a ring for everyone and a ring for no one. The :focus-visible selector applies a focus style when the browser decides the user is navigating by keyboard, and generally skips it for mouse clicks on buttons and links:

:focus-visible {
  outline: 3px solid #1a5fd0;
  outline-offset: 2px;
}

Pick a color that stands out against both your background and your buttons. Then search your theme and page builder settings for outline: none and outline: 0, and delete any that are not paired with a visible replacement. MDN's reference on :focus-visible covers how each browser decides when to show it. This is WCAG 2.4.7, Focus Visible.

Focus that jumps around: positive tabindex

What you will see: focus goes from the logo straight to a newsletter field in the footer, then back up to a button halfway down, then into the menu. The order makes no sense, and a keyboard user loses track of where they are.

The cause is a positive tabindex value, like tabindex="1" or tabindex="3". Any element with a positive value is pulled ahead of everything else on the page, in numeric order. Someone usually added one to make a "Book now" button come first, then a plugin added more, and the tab order turned into a scavenger hunt.

The fix: delete every positive tabindex. Only two values belong in your markup. tabindex="0" adds an element to the natural order, and tabindex="-1" makes it focusable by script without putting it in the Tab sequence. If something needs to come earlier, move it earlier in the HTML. MDN's tabindex page explains why positive values cause more problems than they solve.

While you are tabbing, also notice anything you can click with a mouse that the Tab key skips entirely: a service card, a "Read more" tile, a custom dropdown. These are usually div or span elements with a click handler and no keyboard support. The fix is to make them a real <button> or <a>, which come with focus and Enter support built in. The post on accessibility issues a screen reader finds covers the other half of that problem, along with reading order and labels. If your homepage has a contact form, tabbing through it deserves its own pass, and the contact form audit walks through it field by field.

The menu button that opens but never says so

Narrow your browser window until the hamburger icon appears. Tab to it and press Enter.

Three things should happen. The menu opens. Your next Tab goes into the menu links, not past them to the page underneath. Escape closes the menu and returns focus to the button. If the button never receives focus at all, it is one of the click-only elements from the previous section.

Then there is the part you cannot see. A screen reader user who presses that button hears "Menu, button" before and after, with nothing to say the menu is now expanded. FAQ accordions fail the same way.

The fix is one attribute, aria-expanded, toggled by the same script that opens the menu:

<button aria-expanded="false" aria-controls="mobile-nav">Menu</button>
<nav id="mobile-nav" hidden>
  <!-- menu links -->
</nav>

When the menu opens, set aria-expanded="true". When it closes, set it back to "false". You can check this without a screen reader: right-click the button, choose Inspect, then press Enter on the button and watch the attribute in the developer tools. If it never changes, or is not there at all, the button is silent.

One setting the Tab key will not show: reduced motion

macOS, iOS, Windows and Android all offer a reduce motion setting. People with vestibular disorders or migraines turn it on because parallax scrolling, sliding carousels and fade-in-on-scroll effects can cause dizziness or nausea. Browsers pass the setting to your site through the prefers-reduced-motion media query, but only sites that check for it can honor it.

To test, turn the setting on (on a Mac: System Settings, Accessibility, Display, Reduce motion; on Windows 11: Settings, Accessibility, Visual effects, then switch Animation effects off) and reload your homepage. If the hero still slides, the sections still fly in and the carousel still rotates, your site is ignoring the request.

The fix is one media query in your stylesheet:

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

MDN's prefers-reduced-motion reference shows gentler versions that swap motion for a simple fade. If your carousel rotates on its own, also turn on its pause control. WCAG 2.2.2 requires a way to pause moving content that starts automatically and runs longer than five seconds, and most slider plugins offer it as a setting.

What to run after the Tab test

The Tab test tells you how the page feels. A scan tells you which lines of markup are causing it. The free accessibility check looks for every problem in this post: no skip-to-content link, inline outline: none with no :focus-visible replacement, positive tabindex values, click handlers on div and span elements with no keyboard support, menu and accordion toggles with no aria-expanded, and animations with no prefers-reduced-motion rule. The same checks run inside the full AcuityScan scan, part of 350+ checks across 8 modules, so keyboard problems show up next to performance, security header and email findings for the same domain.

Do the two minutes first, though. Put the mouse in a drawer, press Tab, and count how many presses it takes to reach your headline. That number is the first thing every keyboard visitor learns about your business.

Scan your own site

See what 350+ checks find on your domain.

Free, no signup, 60 seconds. Email auth · DNS · SSL · Performance · SEO · Accessibility · Privacy · Mobile.