Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

scroll-target-group — grouping scroll markers

The scroll-target-group property groups existing scroll markers, allowing the active navigation link to be highlighted with :target-current.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

scroll-target-group: none | auto;

scroll-target-group: auto establishes a scroll marker group container, for example for section links. Each marker belongs to its nearest such ancestor, so nested groups are independent.

none is the initial value and establishes no group. The property applies to all elements, is not inherited, and animates discretely.

The active marker matches :target-current; the browser selects it based on scrolling. Unlike scroll-marker-group, this property generates neither ::scroll-marker-group nor new markers.

This is a draft specification feature. The example requires local verification in the target browser; retain working links as the navigation baseline.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Scroll target group</title>
<style>
  nav { position: fixed; top: 0; background: white; scroll-target-group: auto; }
  nav a { padding: 0.5rem; display: inline-block; }
  nav a:target-current { color: black; background: gold; font-weight: bold; }
  section { box-sizing: border-box; height: 100vh; padding: 5rem 1rem; }
</style>
<nav aria-label="Sections">
  <a href="#one">One</a>
  <a href="#two">Two</a>
</nav>
<main>
  <section id="one"><h1>One</h1></section>
  <section id="two"><h2>Two</h2></section>
</main>
</html>

Result

In a supporting browser, the active navigation link has a gold background and bold black text. Activating Two scrolls to section Two and highlights its link; activating One returns to section One and highlights its link.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources