Focus Management Accessibility Checker
WCAG 2.4.7 requires a visible focus indicator on all interactive elements. Removing CSS outlines without replacement is one of the most harmful accessibility practices on the web.
No signup required. Results in under 60 seconds.
What WCAG 2.4.3 and 2.4.7 Require
WCAG 2.4.3 (Focus Order, Level A) requires that when content can be navigated sequentially, components receive focus in an order that preserves meaning and operability. WCAG 2.4.7 (Focus Visible, Level AA) requires that any keyboard-operable interface has a visible focus indicator — users must always be able to see which element currently has focus. WCAG 2.2 adds 2.4.11 (Focus Not Obscured Minimum, Level AA) requiring that focused elements are not entirely hidden by sticky headers, modals, or other overlapping content, and 2.4.13 (Focus Appearance, Level AAA) specifying minimum focus indicator size and contrast. The single most common focus violation is the CSS declaration outline: none applied globally, which removes the browser's default focus indicator without providing a replacement — effectively making keyboard navigation blind.
Why Focus Indicators Are Critical
Focus indicators serve keyboard users the same way a cursor serves mouse users — they show where you are on the page:
- Without focus indicators, keyboard users are lost. Pressing Tab moves focus, but if nothing visually changes, the user has no idea which element is active. This makes the website effectively unusable
- Screen magnification users rely on focus indicators to track their position when they can only see a portion of the screen at any time
- Cognitive disability users benefit from clear focus indicators that reduce the mental effort of tracking their position during form completion or navigation
- Motor disability users navigating with switches or voice control need to confirm their selection before activating it — impossible without a visible indicator
Removing outline: none is among the quickest accessibility fixes you can make. A single CSS rule change can improve usability for millions of users. If you dislike the default browser outline, replace it with a custom focus style — never simply remove it.
Code Examples for Proper Focus Management
Implementing accessible focus indicators:
- Custom focus style (recommended):
:focus-visible { outline: 2px solid #1a73e8; outline-offset: 2px; border-radius: 2px; }— uses:focus-visibleto show outlines only for keyboard navigation, not mouse clicks - Never do this:
*:focus { outline: none; }— removes all focus indicators globally. If your CSS framework does this, override it immediately - Focus trapping in modals:
document.querySelector('.modal').addEventListener('keydown', (e) => { if (e.key === 'Tab') { /* cycle focus within modal */ } }); - Managing focus on route changes (SPA): After a client-side navigation, move focus to the new page's main heading:
document.querySelector('h1').focus();— otherwise focus stays on the clicked link, which may no longer be visible - Skip link:
<a href="#main" class="skip-link">Skip to main content</a>with CSS that shows it only on focus, allowing keyboard users to bypass repetitive navigation
How CompliScan Detects Focus Issues
CompliScan detects several categories of focus violations: CSS rules that remove outlines without replacement (outline: none or outline: 0), interactive elements with tabindex="-1" that should be in the tab order, positive tabindex values that disrupt natural focus order, and missing skip navigation links. The scanner also identifies elements where focus order does not match visual layout — for example, CSS order or flex-direction: row-reverse that rearranges elements visually while the DOM order (and thus focus order) remains different. Each issue includes the exact CSS declaration or HTML element responsible and AI-powered fix suggestions. Automated scanning catches structural focus issues, but testing whether focus is visible enough or whether the focus order is logical often requires manual verification. Start with a free CompliScan scan, then Tab through your site to verify the experience. Shield Pro ($149/mo) provides daily monitoring to catch focus regressions from CSS updates.
Frequently Asked Questions
What is :focus-visible and should I use it?
The :focus-visible CSS pseudo-class matches when an element has focus AND the browser determines the user is navigating via keyboard (not mouse). It is supported in all modern browsers and is the recommended approach for focus styling — it shows focus indicators for keyboard users while avoiding the 'ugly outlines' that designers dislike when clicking with a mouse. Use :focus-visible instead of :focus for your custom focus styles, and keep :focus as a fallback for older browsers.
How do I handle focus in single-page applications?
SPAs have a unique focus challenge: after client-side route changes, focus stays on the element that triggered navigation (often a link that is no longer visible). Best practice: after each route change, move focus to the new page's main heading or a 'skip to content' target. Also announce route changes to screen readers using an aria-live region. Frameworks like React, Angular, and Vue have accessibility-focused routing solutions that handle this automatically.
What is the minimum focus indicator size in WCAG 2.2?
WCAG 2.2 criterion 2.4.13 (Focus Appearance, Level AAA) specifies that the focus indicator must have an area of at least 2px along the perimeter of the element and a 3:1 contrast ratio between focused and unfocused states. The Level AA criterion 2.4.11 (Focus Not Obscured) does not specify a size but requires the focus indicator not be entirely hidden by other content. In practice, a 2px solid outline with 3:1 contrast meets both criteria.
Should I use tabindex to control focus order?
Generally, no. The best focus order comes from a logical DOM order that matches the visual layout. Use tabindex='0' only to make custom interactive elements focusable. Use tabindex='-1' for elements you want to focus programmatically but not include in the tab order (like modal containers). Never use positive tabindex values (1, 2, 3, etc.) — they override natural order and create maintenance nightmares. If your focus order is wrong, fix the DOM order or CSS layout rather than adding tabindex values.
More Free Tools
Check Your Website Now
Enter your URL below and get a free accessibility report with AI-powered fix suggestions in under 60 seconds.
No signup required. Results in under 60 seconds.