:open
Targets elements that are currently in an 'open' state, such as a <details> element that is expanded or a <dialog> that is visible.
Syntax
/* Usage Example */
details:open {
/* Adds a top border to the content box only when the details are open */
border-top: 2px solid #3b82f6;
}
:open Browser support
Limited availability
Since
2020 71% global usage
This feature is not Baseline because it does not work in some of the most widely-used browsers.
133+
136+
133+