:popover-open
Widely availableSince 202494% of users
Matches elements with the popover attribute that are currently in their open state. It allows you to style top-layer content like menus and tooltips specifically when they are visible.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyModernIn every major browser since April 2024. Widely available since October 2026.
The old way and the modern waySee the snippet: Dropdown menus without JavaScript toggles →
Old way 7 lines
.menu {
display: none;
}
.menu.open {
display: block;
}
/* JS: toggle class, document click-outside, keydown ESC, aria-expanded, aria-hidden */Modern 12 lines
/* <button id="menu-button" popovertarget="menu"> ... <div id="menu" popover> */
#menu-button {
anchor-name: --menu;
}
#menu[popover] {
position: absolute;
position-anchor: --menu;
position-area: bottom span-right;
inset: auto;
margin: 0.25rem 0 0;
}
/* Toggle, light dismiss, ESC: built in. */See how modern your own CSS is.Check your CSS →
Quick example
[popover]:popover-open {
/* Styles the popover only when it's active and visible */
border: 2px solid var(--accent);
opacity: 1;
transform: translateY(0);
transition: all 0.3s allow-discrete;
}:popover-open browser support
BaselineWidely availableThis feature is well established and works across many devices and browser versions. It has been available across browsers since 2024.Safe to use without fallbacks.
Usage94%of people can use this6% use a browser without it.
Browsers
114+
125+
17+
114+Mobile
114+Android
125+Android
17+iOS