:target-current

The :target-current CSS pseudo-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 for examples of using 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

See also