Content on Hover or Focus: Tooltips Done Right
Also called: Tooltip accessibility, Hover pop-ups, Dismissible tooltips
Definition
Content on hover or focus is WCAG success criterion 1.4.13. Where pointer hover or keyboard focus makes extra content appear – a custom tooltip, sub-menu or pop-up – it must be dismissible without moving the pointer or focus, hoverable, and persistent until the user is done.
Content on hover or focus means tooltips, sub-menus and small pop-ups that appear when the mouse rests on an element or the keyboard focus reaches it. WCAG 1.4.13 does not forbid them, but sets three rules: people must be able to close them, move the pointer onto them, and read them for as long as they need. Without these rules, a tooltip can cover the very text someone is trying to read.
What it means
WCAG 1.4.13 Content on Hover or Focus is a Level AA criterion in WCAG 2.2. Where receiving and then removing hover or focus triggers additional content, all three conditions apply:
| Condition | Requirement | Exception |
|---|---|---|
| Dismissible | It can be closed without moving the pointer or focus, e.g. with Escape | It shows an input error, or it covers no other content |
| Hoverable | If hover triggers it, the pointer can move onto it without it disappearing | – |
| Persistent | It stays visible until hover or focus moves away, the user closes it, or its information is no longer valid | – |
Browser tooltips from the HTML title attribute are exempt: their look is controlled by the browser, not the author. Custom tooltips, sub-menus and other non-modal pop-ups are covered. A skip link that appears on focus is not covered, because it adds no extra content.
Why it matters: screen magnifier users pan by moving the pointer or focus, so a tooltip that vanishes when the pointer moves is impossible to read at 400 % zoom. People with a large mouse pointer need to move onto the tooltip to see what the pointer hides. People with low vision or cognitive disabilities need time to notice new content.
Examples
<button type="button" aria-describedby="tip-vat" class="has-tip">
Price incl. VAT
</button>
<div role="tooltip" id="tip-vat" class="tip" hidden>
VAT is calculated from your billing country.
</div>
<script>
// Show on hover and focus, keep open while the pointer is over the tooltip,
// close with Escape without moving the pointer or focus.
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') document.getElementById('tip-vat').hidden = true;
});
</script>The tooltip is linked with aria-describedby, so screen readers read it with the button. It touches the button with no gap, so the pointer can move from the trigger onto the tooltip without it closing.
Close tooltips and pop-ups with Escape, leave no gap between trigger and tooltip, keep content open while the pointer is over it, and work the same way with keyboard navigation and the mouse.
Hide the tooltip after a fixed timeout, close it as soon as the pointer leaves the trigger, show it on hover only, or let it cover the focused element.
How to check content on hover or focus
Questions
What does dismissible, hoverable and persistent mean?
Dismissible: you can close it without moving pointer or focus. Hoverable: the pointer can move onto it without it vanishing. Persistent: it stays until you move away, close it, or its information is no longer valid.
Does the title attribute fail WCAG 1.4.13?
No. Tooltips created by the title attribute are controlled by the browser and are named by W3C as the exception. They have other problems – they do not show on keyboard focus or touch – so do not rely on them for important information.
Do tooltips need to close with the Escape key?
WCAG requires "a mechanism" to dismiss them without moving pointer or focus. Escape is the common, expected solution. Content that shows an input error or covers no other content does not need one.
Are hover menus covered by 1.4.13?
Yes. W3C names sub-menus explicitly. A navigation menu that opens on hover must stay open while the pointer moves into it and must close with Escape if it covers other content.
How can I test tooltips across many pages?
Check each tooltip and menu component once in your design system or template, then spot-check pages. The free WCAG scanner finds related code issues, such as icon buttons without a name.
Related terms
Focus Visible: WCAG 2.4.7 and Visible Focus Styles
Focus visible means that a website shows a visible indicator – usually an outline – on the link, button or field that currently has keyboard focus. WCAG 2.4.7 requires it at Level AA.
Read definition: Focus Visible: WCAG 2.4.7 and Visible Focus StylesKeyboard Navigation: WCAG 2.1.1 Explained
Keyboard navigation means that every function of a website can be reached and operated with a keyboard alone – usually with Tab, Shift+Tab, Enter, Space and the arrow keys. WCAG 2.1.1 requires it at Level A.
Read definition: Keyboard Navigation: WCAG 2.1.1 ExplainedFocus Not Obscured: Keep the Focused Item Visible
Focus Not Obscured (Minimum) is WCAG success criterion 2.4.11. When a user interface component receives keyboard focus, it is not entirely hidden due to author-created content such as sticky headers, footers or non-modal dialogs.
Read definition: Focus Not Obscured: Keep the Focused Item VisibleReflow: Content That Fits at 400% Zoom
Reflow is WCAG success criterion 1.4.10. Content must work without loss of information or functionality and without scrolling in two directions at a width equal to 320 CSS pixels – or a height of 256 CSS pixels for horizontally scrolling content.
Read definition: Reflow: Content That Fits at 400% Zoom