大网数据广告活动
Web 标准与前端开发

CSS overscroll behavior

· 52CE 我爱测

The **CSS overscroll behavior** module provides properties to control the behavior of a Scroll_container when its scroll position reaches the Scroll_boundary. Controlling this aspect is particularly useful in scenarios where embedded scrollable areas should not trigger scrolling

The CSS overscroll behavior module provides properties to control the behavior of a Scroll_container when its scroll position reaches the Scroll_boundary. Controlling this aspect is particularly useful in scenarios where embedded scrollable areas should not trigger scrolling of the parent container.

When commenting on a blog, you might notice that if your comment exceeds the length of the provided textarea, scrolling beyond the end of the text area causes the entire blog to scroll. This is because reaching the end of a scrollable area, known as the Scroll_boundary, can lead to scrolling other content or the entire page. This continuous scrolling experience is called Scroll_chaining.

In situations where the contents of an element are larger than its container and overflow allows or defaults to scrolling (like in <textarea>), continued scrolling past the element's scrollable area will initiate scrolling in the parent element or the underlying page.

Conversely, scrolling through a website's terms and conditions and reaching the end of the content to enable a checkbox, may not force the page to scroll or bounce (as on a phone). This example shows that you can control overscroll behavior and prevent scroll chaining.

This module defines the overscroll behavior, enabling you to specify the actions when a user scrolls beyond the boundaries of a scrollable element.

Reference

CSS properties

  • overscroll-behavior shorthand
  • overscroll-behavior-block
  • overscroll-behavior-inline
  • overscroll-behavior-x
  • overscroll-behavior-y

Glossary terms

  • Scroll_boundary
  • Scroll_chaining

Guides

Related concepts

  • scrollbar ARIA role

  • Containing block concept

  • CSS overflow module:

    • overflow shorthand property
      • overflow-x
      • overflow-y
      • overflow-block
      • overflow-inline
    • overflow-clip-margin property
    • scroll-behavior property
    • text-overflow property
  • Scroll_container and scrollport glossary terms

  • CSS scroll snap module:

    • scroll-padding shorthand property
    • scroll-snap-type property
    • scroll-margin shorthand property
    • scroll-snap-stop property
    • scroll-snap-align property
  • CSSOM view module:

    • Element.getBoundingClientRect() method
    • Element.scroll() method
    • Element.scrollBy() method
    • Element.scrollIntoView() method
    • Element.scrollTo() method
    • Document.scroll_event Document event

Specifications

See also

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。