CSS overscroll-behavior Property

❮ Previous Reference Next ❯

Example

.container {
  width: 300px;
  height: 300px;
  border: medium dotted;
  padding: 10px;
  text-align: left;
  overflow: auto;
  display: flex;
}

.box {
  width: 50%;
}

#example {
  width: 50%;
  height: 200px;
  border: medium dotted #1A73E8;
  padding: 5px;
  margin: 0 5px;
  text-align: left;
  overflow: auto;
  overscroll-behavior: contain;
}





Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum is simply dummy text of the printing and typesetting industry.

Meaning:

The overscroll-behavior CSS property sets what a browser does when reaching the boundary of a scrolling area.

This property is a shorthand for overscroll-behavior-x and overscroll-behavior-y.

Default value:auto
Inherited:No
Animatable:No
Version:CSS3
JavaScript syntax:
object.style.overscrollBehavior="auto|contain|none|initial|inherit|revert|revert-layer|unset";



Standard Syntax

overscroll-behavior: auto|contain|none|initial|inherit|revert|revert-layer|unset;



Browser Support




Status







Property Values

The following table describes the values of this property:

Value Description
auto The default scroll overflow behavior occurs as normal.
contain Default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll chaining occurs to neighboring scrolling areas, e.g. underlying elements will not scroll.
none No scroll chaining occurs to neighboring scrolling areas, and default scroll overflow behavior is prevented.
initial Sets this property to its default value.
inherit If specified, the associated element takes the computed value of its parent element animation-delay property.
revert Reverts the cascaded value of the property from its current value to the value the property
revert-layer Rollback styles to the ones specified in previous cascade layers.
unset Resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not.



Default CSS Property Values

selectors {
  overscroll-behavior: auto;
}
❮ Previous Reference Next ❯