![]() |
VOOZH | about |
This class accepts more than one value in tailwind CSS. It is the alternative to the CSS Overscroll-behavior property. This class 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.
There is separate property in CSS for CSS Overscroll-behavior-x and CSS Overflow-behavior-y, but we will cover it in this single article.
Overscroll Behavior class:
overscroll-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.
Syntax:
<element class="overscroll-auto">...</element>Example:
Output:
overscroll-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.
Syntax:
<element class="overscroll-contain">...</element>Example:
Output:
overscroll-none: It is used to prevent scroll-chaining on all elements. The default scroll overflow behavior is also prevented.
Syntax:
<element class="overscroll-none">...</element>Example:
Output:
Overscroll-behavior-y: This class 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.
overscroll-y-auto: This is used to set the scrolling behavior on the y-axis 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.
Syntax:
<element class="overscroll-y-auto">...</element>Example:
Output:
overscroll-y-contain: It is used to set the scrolling behavior on the y-axis to default only on the element used. No scroll-chaining would occur on the neighboring scrolling areas and the elements behind will not scroll.
Syntax:
<element class="overscroll-y-contain">...</element>Example:
Output:
overscroll-y-none: It is used to prevent scroll-chaining on the y-axis on all elements. The default scroll overflow behavior is also prevented.
Syntax:
<element class="overscroll-y-none">...</element>Example:
Output:
Overscroll-behavior-x: This class used to set the behavior of the browser when the horizontal 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.
overscroll-x-auto: It is used to set the scrolling behavior on the x-axis 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.
Syntax:
<element class="overscroll-x-auto">...</element>Example:
Output:
overscroll-x-contain: It is used to set the scrolling behavior on the x-axis to default only on the element used. No scroll-chaining would occur on the neighboring scrolling areas and the elements behind will not scroll.
Syntax:
<element class="overscroll-x-contain">...</element>Example:
Output:
overscroll-x-none: It is used to prevent scroll-chaining on the x-axis on all elements. The default scroll overflow behavior is also prevented.
Syntax:
<element class="overscroll-x-none">...</element>Example:
Output: