Level
AA
Since
WCAG 2.1
Entries
19 / 193
/ WCAG criterion

1.4.13 Content on Hover or Focus

When pointing at or tabbing to something makes extra content appear, the user must be able to dismiss it, move the pointer onto it, and keep it on screen for as long as they need.

/ What it requires

Tooltips, dropdown submenus and preview cards that appear when a pointer rests on a control, or when the control takes keyboard focus, are covered here. The criterion sets three conditions for them. People who use screen magnification are hit hardest when these fail: at high zoom a popup can cover the very thing they were reading, or vanish the moment they move the pointer towards it. People with tremor or low dexterity lose content that closes on a small slip.

The content must be dismissible without moving the pointer or the focus, usually with Escape, unless it reports an input error or does not cover or replace other content. It must be hoverable: the pointer can travel from the trigger onto the new content without it closing. It must be persistent: it stays until the hover or focus is removed, the user dismisses it, or its information is no longer valid. Tooltips drawn by the browser itself, such as an unmodified title attribute, are exempt.

/ How pages fail it

  • A CSS-only tooltip shown with :hover closes as soon as the pointer leaves the trigger, so it cannot be reached with the pointer or read at high zoom.
  • A custom tooltip covers neighbouring text and Escape does nothing, so the only way to get rid of it is to move the pointer away.
  • A gap of a few pixels between a menu button and its submenu makes the submenu close while the pointer crosses it.
  • A hint disappears on a timer after a short while, whether or not the reader has finished.
  • The tooltip opens on mouse hover only and never on keyboard focus, which leaves keyboard users without it and also fails criterion 2.1.1.

/ How to check it yourself

  1. Move the pointer over every control that shows a tooltip, submenu or popover, then slide the pointer from the trigger onto the new content. It has to stay open while you do.
  2. With the content showing, press Escape without moving the pointer. It should close, unless it covers nothing or reports an input error.
  3. Tab to the same controls with the keyboard and confirm the same content appears on focus and stays until you tab away or press Escape.
  4. Leave the pointer still for a while and check the content does not close on its own. Repeat the pass with the browser zoomed in, where a popup is more likely to cover other content.

/ How to fix it

  • Add a keydown listener for Escape that hides the tooltip and leaves focus on the trigger.
  • Place the tooltip so that it touches its trigger, and keep it open while :hover matches either the trigger or the tooltip itself. The pointer can then move onto it.
  • Show the content on focus as well as on hover (the focus and blur events, or :focus-visible and :focus-within in CSS), and connect it to the trigger with aria-describedby and role="tooltip".
  • Remove any setTimeout that hides the content. Close it only on mouseleave, blur, Escape, or when the information stops being true.
  • For anything longer than a short hint, or anything that contains links, use a button that expands and collapses the content instead of a hover popup.

/ What our scanner checks

Our check, tooltip-hover-only, finds elements with role="tooltip" or a class name containing the word tooltip. It reports one when no control points to it with aria-describedby and the element next to it cannot take keyboard focus. The check does not hover over anything, so it cannot tell whether a tooltip can be dismissed with Escape, reached with the pointer, or stays open. Those three conditions need a manual test.

/ Who fails it, in our own measurements

Measured bodies failing this criterion, most instances first
BodySectorInstancesScore
Gorzów Wielkopolskicity · PL926
Warszawacity · PL4920
Bydgoszczcity · PL427
Düsseldorfcity · DE409
Zielona Góracity · PL397
Hamburgcity · DE3422
Radomcity · PL262
Politechnika Łódzkaeducation · PL185
Lublincity · PL1617
Wrocławcity · PL152
Amtraktransport · US141
Politechnika Wrocławskaeducation · PL1417
Stuttgartcity · DE136
Policjagovernment · PL1112
Trybunał Konstytucyjnygovernment · PL914
San Diegocity · US252
Houstoncity · US17
PKP Intercitytransport · PL12
State of Washingtongovernment · US18

One page per body, measured by automated checks on a weekly schedule. Any body that has fixed something since the last sweep will show it at the next one, and every entity page carries a right of reply.

/ Questions about this criterion

Does the title attribute fail WCAG 1.4.13?

No. The criterion exempts content whose presentation is controlled by the browser and not modified by the author, and the native title tooltip is the standard example. That does not make title a good choice: browsers show it on mouse hover only, so keyboard and touch users never see it. Anything important belongs in visible text.

Does a tooltip have to close when Escape is pressed?

The criterion asks for a way to dismiss the content without moving the pointer or the focus, and Escape is the usual way to provide it. Dismissal is not required when the content reports an input error or does not cover or replace anything else on the page. A tooltip that appears over empty space therefore passes without it.

Does 1.4.13 apply to menus and popovers that open on click?

No. It applies to content that appears when a pointer hovers over something or when something receives keyboard focus, and disappears again when the hover or focus ends. A menu or dialog that opens on a click, a tap or the Enter key is outside its scope. A navigation submenu that opens on hover is inside it.