demo · v138

scroll-target-group

Two side-by-side scrollers with the same content. Click the links above each. On the right, scroll-target-group: auto snaps to the nominated section; on the left, the default behaviour can land mid-paragraph if scroll-snap or anchor offsets fight you.

checking support…

without scroll-target-group

A1 — Intro
A2 — Body
A3 — End

with scroll-target-group: auto

click a link above to scroll either column

the code

.scroller .sec { scroll-target-group: auto; }
/* Marks each .sec as a scroll-target. Fragment navigation and
   scrollIntoView consult this when deciding what to land on, instead
   of always picking the literal element with that id. */

see also