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

scroll-behavior

Description

The scroll-behavior property for CSS specifies the scrolling behavior for a scrolling box, when scrolling happens due to navigation or CSSOM scrolling APIs.

Other scrolls, such as those performed by the user, are not affected by this property.

Syntax

CSS

scroll-behavior: value;

JS

object.style.scrollBehavior = "value";

Values

<'scroll-behavior'> = auto | smooth
auto

The scrolling box is scrolled in an instant fashion.

smooth

The scrolling box is scrolled in a smooth fashion using a user-agent-defined timing function over a user-agent-defined period of time.

Initial

auto

Examples

1 · auto

2 · smooth

3 · JS