Menu Riverview Church

SCROLL-SNAP-TYPE

The scroll-snap-type property specifies whether a scroll container is a scroll snap container, how strictly it snaps, and which axes are considered.

If no strictness value is specified, proximity is assumed.

SYNTAX

CSS

scroll-snap-type: value;

JS

object.style.scrollSnapType = "value";

VALUES

<'scroll-snap-type'> = none | [ x | y | block | inline | both ] [ mandatory | proximity ]?
none

The scroll container must not snap.

x

The scroll container snaps to snap positions in its horizontal axis only.

y

The scroll container snaps to snap positions in its vertical axis only.

block

The scroll container snaps to snap positions in its block axis only.

inline

The scroll container snaps to snap positions in its inline axis only.

both

The scroll container snaps to snap positions in both of its axes independently.

mandatory

The scroll container is required to be snapped to a snap position when there are no active scrolling operations.

proximity

The scroll container may snap to a snap position at the termination of a scroll, at the discretion of the user agent given the parameters of the scroll.

INITIAL

none

EXAMPLES

NONE

X

Y

BLOCK

INLINE

BOTH

MANDATORY

PROXIMITY

JS

INTERNAL

scroll-snap-align

scroll-snap-stop

EXTERNAL

World Wide Web Consortium (W3C)