overscroll-behavior-y
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2022年9月.
overscroll-behavior-y CSS 属性设置浏览器在到达滚动区域的垂直边界时的行为。
有关完整说明,请参阅 overscroll-behavior。
css
/* 关键字值 */ overscroll-behavior-y: auto; /* 默认 */ overscroll-behavior-y: contain; overscroll-behavior-y: none; /* 全局值 */ overscroll-behavior-y: inherit; overscroll-behavior-y: initial; overscroll-behavior-y: revert; overscroll-behavior-y: revert-layer; overscroll-behavior-y: unset; 语法
overscroll-behavior-y 属性的值是从以下列表中选择的关键字。
取值
形式定义
形式语法
overscroll-behavior-y =
contain |
none |
auto
示例
>阻止底部元素在垂直方向上滚动
css
.messages { height: 220px; overflow: auto; overscroll-behavior-y: contain; } 有关完整示例和解释,请参阅 overscroll-behavior。
规范
| Specification |
|---|
| CSS Overscroll Behavior Module Level 1> # overscroll-behavior-longhands-physical> |
浏览器兼容性
Loading…