Favorites

:interest-target CSS Pseudo Class

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

The :interest-target pseudo-class matches the element shown by an interestfor element while interest is being shown.

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-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

<a href="#" interestfor="card">Ada Lovelace</a>
<div id="card" popover>
<strong>Ada Lovelace</strong><br>
Mathematician and writer, known for her notes on the Analytical Engine.
</div>
a {
font: 18px system-ui, sans-serif;
}

[popover] {
margin: 0;
width: 240px;
padding: 12px;
border: 1px solid #ccc;
border-radius: 8px;
font-family: system-ui, sans-serif;
}

/* The hover card while interest is shown */
[popover]:interest-target {
border-color: gold;
box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.5);
}
Open in editor

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.

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.