:interest-target CSS Pseudo Class
The :interest-target pseudo-class matches the element shown by an interestfor element while interest is being shown.
Description
The :interest-target pseudo-class matches the target of an interest invoker (the element referenced by another element's interestfor attribute) while interest is being shown in it. It is typically used to style or animate a tooltip or hover card while it is open.
Interest invokers are a new HTML feature. Adding an interestfor attribute to a button or link, with the id of another element as its value, makes the browser "show interest" when the user hovers over, focuses or long-presses the invoker. After a short delay (controlled by the interest-delay properties) the target, usually a popover, is shown, and it is hidden again when interest is lost. This allows tooltips and hover cards without JavaScript.
[popover]:interest-target {
outline: 3px solid gold;
}
Its counterpart :interest-source matches the invoker at the same time. When the target is a popover, it also matches :popover-open while it is visible; :interest-target is more specific, because it only matches when the popover was opened through interest. The pseudo-class is experimental and currently only supported in Chromium-based browsers.
Syntax
:interest-target {
/* ... */
}Example
Browser Support
The following information will show you the current browser support for the CSS :interest-target pseudo class. Hover over a browser icon to see the version that first introduced support for this CSS pseudo class.
Desktop





Tablets & Mobile





