Visual focus is all about navigation. Users who rely heavily, or even solely, on a keyboard need clear on-screen indications of what objects or links are selected so that they can properly navigate your site and access what they need. To ensure this accessibility, you need to make sure that ALL navigational elements on a page are compatible with the visual focus indicator. Any option that requires a mouse is essentially blocked off to users who rely on keyboards — so, as a developer and designer, you need to take care to make sure this never happens.
Testing Visual Focus Yourself
Use the "Tab" key on your keyboard for general navigation. You should be able to use "Tab" to bring each individual element clearly into focus, and the "Enter" key should select it. If there is no clear visual change to a particular element as you tab to it, you’ll need to make adjustments to ensure fluid accessibility for all users.
Challenges to Overcome and Other Important Considerations
If you're running an audit of your website to help make sure it's accessible as possible, there are a few important things you'll want to look at in terms of visual focus.
Visual Focus Best Practices
To provide the most accessibility-friendly experience possible for all users, developers should avoid overriding the default focus indicator that most web browsers have. All popular browsers have a built-in focus feature that displays a visible outline around whatever element on screen currently has the keyboard focus.
Instead of disabling this feature, enhance it. Browsers like Internet Explorer show a thin dotted line around whatever object has the keyboard focus, which can be hard to see for some users. You can use the "focus selector" in CSS to define a style change to customize this indicator and make it easier to see on your own page.
Also pay close attention to how visual focus settings affect other elements on a page. A simple border is an efficient way to indicate focus on an element like a link, but it might create issues for things like buttons, tabs, and menus. In these situations, a visual change other than a border — such as a glow or reversed colors — would be most helpful.