css pseudo class
`:target-current` CSS pseudo-class
Limited availability
The :target-current CSS pseudo-class selects the active scroll marker — the scroll marker of a scroll-marker-group that is currently scrolled to. This selector can be used to style the active navigation position within a scroll marker group.
[!NOTE] The
:target-currentpseudo-class is only valid on::scroll-markerpseudo-elements and elements that have been designated as scroll markers using thescroll-target-groupproperty.
Syntax
:target-current {
/* ... */
}
Examples
See Creating CSS carousels and ::scroll-marker for complete examples that use the :target-current pseudo-class.
Basic usage
::scroll-marker {
background-color: white;
}
::scroll-marker:target-current {
background-color: black;
}
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.