The
overscroll-behavior property is used to set the behavior of the browser when the boundary of a scrolling area is reached. This property can be used to prevent unwanted scrolling in pages where there are multiple scroll areas. It is a shorthand for the
overscroll-behavior-x and
overscroll-behavior-y properties.
Syntax: overscroll-behavior: auto | contain | none | initial | inherit
Property Values:
-
auto: It is used to set the scrolling behavior to default. The whole page along with the element will scroll even if the boundary of the element is reached. It is the default value.
Example:
Output: Scrolling down on the smaller element
👁 auto
-
contain: It is used to set the scrolling behavior to default only on the element used. Scrolling the element further after it has reached the boundary will not scroll the elements behind it. No scroll-chaining would occur in the neighboring scrolling areas.
Example:
Output: Scrolling down on the smaller element
👁 contain
-
none: It is used to prevent scroll-chaining on all elements. The default scroll overflow behavior is also prevented.
Example:
Output: Scrolling down on the smaller element
👁 none
-
initial: It is used to set the overscroll behavior to default value.
Example:
Output: Scrolling down on the smaller element
👁 initial
-
inherit: It is used to set the scrolling behavior to inherit from the parent.
Supported Browsers: The browsers supported by
overscroll-behavior property are listed below:
- Chrome 63.0
- Firefox 59.0
- Edge 18.0
- Opera 50.0