:target-current
An experimental pseudo-class that matches the 'scroll marker' corresponding to the item currently visible in the viewport. This is the 'active' state for carousel indicators.
This is an experimental technology. The syntax and behavior are still subject to change.
Syntax
/* Usage Example */
.carousel::scroll-marker:target-current {
/* Highlights the indicator for the currently visible slide */
background-color: var(--brand-active);
transform: scale(1.2);
}
:target-current Browser support
Limited availability
Since
2020 69% global usage
This feature is not Baseline because it does not work in some of the most widely-used browsers.
135+
135+