:target-current
Experimental:This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The :target-current
CSSpseudo-class selects the active scroll marker — the ::scroll-marker
pseudo-element 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-current
pseudo-class is only valid on ::scroll-marker
pseudo-elements.
Syntax
css
:target-current { /* ... */ }
Examples
See Creating CSS carousels and ::scroll-marker
for complete examples that use the :target-current
pseudo-class.
Basic usage
css
::scroll-marker { background-color: white; } ::scroll-marker:target-current { background-color: black; }
Specifications
Specification |
---|
CSS Overflow Module Level 5 # active-scroll-marker |
Browser compatibility
See also
scroll-marker-group
::scroll-marker
::scroll-marker-group
- Creating CSS carousels
- CSS overflow module
- CSS Carousel Gallery via chrome.dev (2025)