CSS overscroll-behavior-block eigenschap
- Vorige pagina overscroll-behavior
- Volgende pagina overscroll-behavior-inline
Definitie en gebruik
overscroll-behavior-block
De eigenschap wordt gebruikt om de scrollketting (scroll chaining) of de overscroll feedback (overscroll affordance) op het element uit te schakelen wanneer het proberen om buiten de scrollgrenzen in de blokkenrichting te滚動。
The scroll chain refers to the scroll behavior of the parent element when over-scrolling occurs on an element. This is the default behavior.
Over-scroll feedback is the feedback given when the user tries to scroll beyond the scroll boundary. For example, on mobile devices, when trying to scroll beyond the top of the page, there is usually a visual feedback of page refresh.
CSS overscroll-behavior-block
and overscroll-behavior-inline property is related to overscroll-behavior-x and overscroll-behavior-y properties are very similar, but overscroll-behavior-block
and overscroll-behavior-inline The property depends on the block direction and inline direction.
Note:Related CSS properties writing-mode
It defines the block direction. This affects whether the block direction is in the x direction or y direction, and overscroll-behavior-block
The result of the property. For English pages, the block direction is downward, and the inline direction is from left to right.
Instance
Example 1
Turn off the scroll chain of the scrollable <div> element in the block direction:
#yellowDiv { overscroll-behavior-block: contain; }
Example 2: Combining the writing-mode property
Sets the writing-mode
When the property value is set to 'vertical-rl', the block direction becomes the x direction, so overscroll-behavior-block
Now it works in the x direction instead of the y direction:
#yellowDiv { writing-mode: vertical-rl; overscroll-behavior-block: contain; }
CSS Syntax
overscroll-behavior-block: auto|contain|none|initial|inherit;
Property value
Value | Description |
---|---|
auto | Allows scroll chain and over-scroll feedback behavior. Default value. |
contain | Allows over-scroll feedback behavior but does not allow scroll chain. |
none | Does not allow over-scroll feedback or scroll chain behavior. |
initial | Sets this property to its default value. See initial. |
inherit | Inherits this property from its parent element. See inherit. |
Technical details
Default value: | auto |
---|---|
Inheritance: | No |
Animation creation: | Not supported. See:Animation-related properties. |
Version: | CSS3 |
JavaScript Syntax: | object.style.overscrollBehaviorBlock="none" |
Browser Support
The numbers in the table represent the first browser version to fully support this property.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
63.0 | 18.0 | 59.0 | 16.0 | 50.0 |
Gerelateerde pagina's
Referentie:CSS overscroll-behavior eigenschap
Referentie:CSS overscroll-behavior-inline eigenschap
Referentie:CSS overscroll-behavior-x eigenschap
Referentie:CSS overscroll-behavior-y eigenschap
Referentie:CSS scroll-behavior eigenschap
Referentie:CSS scroll-margin eigenschap
Referentie:CSS scroll-padding eigenschap
Referentie:CSS scroll-snap-align eigenschap
Referentie:CSS writing-mode eigenschap
- Vorige pagina overscroll-behavior
- Volgende pagina overscroll-behavior-inline