`:target-current` CSS pseudo-class
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.
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-marker pseudo-elements and elements that have been designated as scroll markers using the scroll-target-group property.
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
Browser compatibility
See also
- scroll-marker-group
- scroll-target-group
- :target-before, :target-after
- ::scroll-marker
- ::scroll-marker-group
- Creating CSS carousels
- CSS overflow module
- CSS Carousel Gallery via chrome.dev (2025)