Tooltips provide compact context but must remain readable and accessible for keyboard and touch users.
Tooltip styling basics
- High contrast background/text.
- Adequate spacing and max-width control.
- Arrow and offset positioning that avoids clipping.
A11y warning
Pure hover-only tooltips are inaccessible on touch and unreliable for keyboard users; provide focus/aria support.
Important interview questions and answers
- Q: Tooltip vs popover?
A: Tooltip is brief supplemental text; popover can contain richer interactive content. - Q: Common tooltip failure?
A: Off-screen clipping and unreadable contrast. - Q: Should essential instructions live only in tooltip?
A: No, critical info must be visible without hover discovery.
Practice: Change one property in the playground and observe cascade + layout in DevTools.