The Web Content Accessibility Guidelines (WCAG) includes many success criteria addressing focus, which indicates which element the user is interacting with.
That’s for a good reason: Appropriate use of focus is essential for delivering a consistent web experience to every user, regardless of the technology they use to access your website.
WCAG 2.1 Success Criterion (SC) 1.4.13, “Content on Hover or Focus,” is intended to prevent an especially annoying set of accessibility barriers. In this article, we’ll discuss methods for meeting WCAG 2.1 SC 1.4.13 and explain how meeting this standard can benefit real-life users.
WCAG SC 1.4.13 requires content that appears on hover or keyboard focus to behave in an understandable and predictable way. This is mostly applicable to pop-ups, which can create a number of frustrating accessibility barriers:
WCAG SC 1.4.13 is intended to address these barriers by requiring content to be dismissable, hoverable, and persistent.
Related: What You Need to Know About Visual Focus and Accessibility
Where receiving and then removing pointer hover or keyboard focus triggers additional content to become visible and then hidden, the following are true:
The criterion contains an exception for situations where “the visual presentation of the additional content is controlled by the user agent and is not modified by the author.”
This exception applies to custom modal dialogs, which are windows that disable access to the main content and require user interaction before access is restored. Modal dialogs can also create accessibility concerns, however.
In modals, the keyboard focus must be managed properly to follow WCAG 2.1 SC 3.2.1, “On Focus" and WCAG 2.1 SC 2.4.7, “Focus Visible.” The modal dialog must also contain accurate HTML and WAI-ARIA markup to deliver correct information to screen readers and other assistive technologies.
Related: What is Keyboard Accessibility?
Pop-up content can be useful (for example, tooltip widgets and custom sub-menus). However, these components can also distract users or prevent them from browsing your website naturally — avoid using pop-ups unless you’re sure that they improve the user experience.
Keep these tips in mind when reviewing content that only appears when triggered by mouse or keyboard focus:
For more guidance with WCAG conformance, send us a message or test your website with our free WCAG 2.1 Level AA compliance summary.