GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • MDN
  • HTML: Markup language
  • Elements
  • Global attributes
  • Attributes
  • See all…
  • Responsive images
  • HTML cheatsheet
  • Date & time formats
  • See all…
  • SVG
  • MathML
  • XML
  • CSS: Styling language

This view

  • Original page
  • New address

GeezerVison is showing developer.mozilla.org — :target-current CSS pseudo-class - CSS | MDN

:target-current CSS pseudo-class

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Want more browser support for this feature? Tell us why.

  • See full compatibility
  • Learn more

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
# selectordef-target-current

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)

Help improve MDN

Learn how to contribute

This page was last modified on Apr 17, 2026 by MDN contributors.

View this page on GitHub • Report a problem with this content
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.