VOOZH about

URL: https://www.geeksforgeeks.org/css/css-overscroll-behavior-y-property/

⇱ CSS overscroll-behavior-y Property - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

CSS overscroll-behavior-y Property

Last Updated : 9 Jun, 2023

The overscroll-behavior-y property is used to set the behavior of the browser when the vertical boundary of a scrolling area is reached. This can be used in websites where there are multiple scrolling areas and scrolling one area does not affect the page as a whole. This effect is known as scroll-chaining which can be enabled or disabled accordingly. 

Syntax:

overscroll-behavior-y: auto | contain | none | initial | inherit

Property Values:

  • auto: This is used to set the scrolling behavior to default on all the elements. The whole page will scroll even if the boundary of the element is reached. It is the default value. 
  • contain: It is used to set the scrolling behavior to default only on the element used. No scroll-chaining would occur on the neighboring scrolling areas and the elements behind will not scroll. 
  • none: It is used to prevent scroll-chaining on all elements. The default scroll overflow behavior is also prevented. 
  • initial: It is used to set the over-scroll behavior to the default value. 
  • inherit: It is used to set the scrolling behavior to inherit from the parent.

Example: 

Output: Scrolling down on the smaller element 

👁 auto

Example: 

Output: Scrolling down on the smaller element 

👁 contain

Example: 

Output: Scrolling down on the smaller element

 👁 none

Example: 

Output: Scrolling down on the smaller element 

👁 initial

Supported Browsers: The browser supported by overscroll-behavior-y property are listed below:

  • Chrome 63.0
  • Firefox 59.0
  • Opera 50.0
Comment