Thanks to visit codestin.com
Credit goes to www.cssportal.com

CSS Portal

CSS scroll-snap-stop Property

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The scroll-snap-stop property controls how strictly a snap point is honored during inertial or high-velocity scrolling. It lets authors indicate that a particular child (or snap candidate) should not be skipped when the user flicks or quickly scrolls through a snap container; instead, the scrolling motion will decelerate and come to rest at that snap position if the property requires it. In practice this changes the behavior of the scroll container’s natural momentum so that certain important items (for example, the first item in a carousel or a critical step in a sequence) reliably become the final resting point.

This property works in the context of CSS Scroll Snap and is meaningful only when snapping is enabled on the container; it complements how the container is configured via scroll-snap-type and how individual children declare their preferred snap alignment using scroll-snap-align. While snap type and align determine whether and where snapping can occur, scroll-snap-stop influences whether a particular candidate must be considered even if the scrolling momentum would normally carry past it. Because of that relationship, it’s often used sparingly — on a few key children — rather than on every snap point.

From a UX perspective, this property helps prevent accidental overscroll past important content while preserving a smooth, momentum-driven feel for other elements. It’s useful in carousels, step-based interfaces, or onboarding flows where landing on a specific item is important for comprehension or interaction. However, overusing it can make rapid navigation feel “sticky” or sluggish, since many forced stops interrupt quick gestures; balance is important to maintain both discoverability and responsiveness.

On implementation and accessibility, consider how forced snap stops interact with keyboard and programmatic scrolling, focus management, and animations. When a forced stop aligns with interactive content (like a form field or focusable control), ensure that focus shifts and announcements are handled predictably so screen reader users are not disoriented. Also be mindful of performance on low-power devices: requiring additional stops can increase the number of scroll events and layout checks the browser performs during momentum scrolling.

Definition

Initial value
normal
Applies to
all elements
Inherited
no
Computed value
as specified
Animatable
yes
JavaScript syntax
object.style.scrollSnapStop

Interactive Demo

The effect of this property can be noticed on devices with a touchpad. Try to scroll through all items with a single swing. Value 'normal' should pass through all pages, while 'always' will stop at the second page.

1
2
3
Scroll »

Syntax

scroll-snap-stop: normal | always

Values

  • normalWhen the visual viewport of this element's scroll container is scrolled, it may "pass over" possible snap positions.
  • alwaysThe scroll container must not "pass over" a possible snap position; and must snap to the first of this elements' snap positions.

Example

<div class='wrap'>
<h2>Scroll snap-stop demo</h2>
<div class='carousel' tabindex='0'>
<div class='card'>1</div>
<div class='card'>2</div>
<div class='card stop'>
3
<small>scroll-snap-stop: always</small>
</div>
<div class='card'>4</div>
<div class='card'>5</div>
</div>
<p class='note'>Try a quick scroll; the highlighted card won't be skipped.</p>
</div>
/* Styles for scroll-snap-stop demo */
* {
  box-sizing: border-box;
}
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  margin: 20px;
  background: #f7f7fa;
  color: #222;
}
.wrap {
  max-width: 900px;
  margin: 0 auto;
}
.carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 20px;
  scroll-snap-type: x mandatory;
  scroll-padding: 20px;
  border: 1px solid #e3e6ea;
  border-radius: 10px;
  background: #ffffff;
}
.card {
  flex: 0 0 280px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 28px;
  color: #fff;
  border-radius: 8px;
  scroll-snap-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.card small {
  display: block;
  font-size: 12px;
  margin-top: 8px;
  opacity: 0.95;
}
.card.stop {
  /* Prevent this snap position from being skipped when scrolling fast */
  scroll-snap-stop: always;
  background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.note {
  margin-top: 12px;
  font-size: 14px;
  color: #555;
}
/* Optional: styling the horizontal scrollbar for WebKit */
.carousel::-webkit-scrollbar {
  height: 10px;
}
.carousel::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 6px;
}

Browser Support

The following information will show you the current browser support for the CSS scroll-snap-stop property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 1st January 2026

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!