:target-current
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
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-current pseudo-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
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> |