Favorites

:interest-source CSS Pseudo Class

:interest-source
CSS Pseudo ClassThis pseudo class is supported in some modern browsers, but not all.
Updated 22nd November 2026

The :interest-source pseudo-class matches an element with the interestfor attribute while the user is showing interest in it.

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.

Description

The :interest-source pseudo-class matches an interest invoker, the element with the interestfor attribute, while interest is being shown in its target. It can be used to highlight the button or link whose tooltip or hover card is currently 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.

button:interest-source {
  background-color: hotpink;
  color: purple;
}

Its counterpart :interest-target matches the target element at the same time. The pseudo-class is experimental and currently only supported in Chromium-based browsers.

Syntax

:interest-source {
  /* ... */
}

Example

<button interestfor="tip">Hover or focus me</button>
<p id="tip" popover>A tooltip shown without JavaScript.</p>
button {
font: 16px system-ui, sans-serif;
padding: 10px 18px;
border: 2px solid #8e44ad;
border-radius: 8px;
background: white;
}

/* The invoker while its tooltip is shown */
button:interest-source {
background-color: hotpink;
color: purple;
}

[popover] {
margin: 0;
padding: 8px 12px;
border: none;
border-radius: 6px;
background: #333;
color: white;
}
Open in editor

Browser Support

The following information will show you the current browser support for the CSS :interest-source pseudo class. Hover over a browser icon to see the version that first introduced support for this CSS pseudo class.

This pseudo class is supported in some modern browsers, but not all.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.