CKTIS / CSS
CSS property `overscroll-behavior-inline`
`overscroll-behavior-inline` sets on the inline axis behavior after a scroller reaches its boundary.
Version: CSS modules; captured CSSWG editor index includes draft and obsolete features requiring review
Syntax
contain | none | autooverscroll-behavior-inline sets on the inline axis behavior after a scroller reaches its boundary.
The example uses a nested scroll container, moves it to the end, and reports its range, boundary position, and computed value.
Grammar: contain | none | auto. This example does not replace wheel and touch testing on the target device.
contain stops scroll chaining but keeps a local boundary effect; none suppresses that effect too. Script cannot synthesize a trusted wheel or touch gesture.
Examples
<!doctype html>
<html lang="en"><meta charset="utf-8"><title>CKTIS CSS reference example</title><body><pre id="result"></pre><script>
const outer=document.createElement("div"),inner=document.createElement("div"),content=document.createElement("div");document.body.prepend(outer);outer.append(inner);inner.append(content);outer.style.cssText="width:100px;height:60px;overflow:auto";inner.style.cssText="width:80px;height:40px;overflow:auto;overscroll-behavior-inline:contain";content.style.cssText="width:200px;height:120px";inner.scrollTop=inner.scrollHeight;inner.scrollLeft=inner.scrollWidth;document.querySelector("#result").textContent="boundary=("+inner.scrollLeft+","+inner.scrollTop+")/"+(inner.scrollWidth-inner.clientWidth)+","+(inner.scrollHeight-inner.clientHeight)+"; computed="+getComputedStyle(inner).getPropertyValue("overscroll-behavior-inline").trim();
</script></body></html>Result
boundary=(135,95)/135,95; computed=contain
The example was executed locally in an isolated, network-free Chrome session; the result comes from the browser CSS API.