HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

scroll-snap-type

Description

The scroll-snap-type property for CSS 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

1 · none

2 · x

3 · y

4 · block

5 · inline

6 · both

7 · mandatory

8 · proximity

9 · JS