::scroll-marker-group CSS Pseudo Element
Description
The ::scroll-marker-group pseudo-element in CSS is used to represent a collection of scroll markers within a scroll container. Scroll markers are indicators placed along a scrollable area, often used in contexts like paged media, printing previews, or accessibility interfaces to denote significant positions in the content. This pseudo-element groups multiple markers together, allowing authors to style them collectively rather than individually.
This pseudo-element is particularly relevant when combined with scroll snapping behaviors. By targeting the group of markers instead of each marker individually, developers can apply styles such as color, background-color, or transform to create visual cues along the scroll axis. For example, a developer might highlight all markers that represent section boundaries in a long document.
The ::scroll-marker-group pseudo-element is often used in combination with the ::scrollbar or ::scrollbar-thumb pseudo-elements to create enhanced custom scrolling experiences. It allows for fine-grained visual control without interfering with the default scrolling behavior of the container.
Here’s a practical example demonstrating basic styling of a scroll marker group:
<div class="scroll-container">
<div class="content">
<section>Section 1</section>
<section>Section 2</section>
<section>Section 3</section>
</div>
</div>
.scroll-container {
scroll-snap-type: y mandatory;
overflow-y: scroll;
height: 300px;
}
.scroll-container::scroll-marker-group {
background-color: rgba(0, 128, 255, 0.2);
height: 6px;
border-radius: 3px;
}
In this example, the ::scroll-marker-group pseudo-element provides a subtle visual track showing where scrollable content sections align, enhancing both usability and accessibility. Unlike targeting individual section elements, the pseudo-element allows styling to be applied consistently to the entire set of scroll markers at once, without additional markup or scripting.
The ::scroll-marker-group pseudo-element is still considered experimental in many browsers, so it is important to test its behavior across different platforms and provide fallback styling when necessary.
Syntax
::scroll-marker-group {
/* ... */
}
Example
Browser Support
The following information will show you the current browser support for the CSS ::scroll-marker-group pseudo element. Hover over a browser icon to see the version that first introduced support for this CSS psuedo element.
This psuedo element is supported in some modern browsers, but not all.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 31st December 2025
