Skip to content

Refine scroll container definition and details - #45937

Merged
chrisdavidmills merged 7 commits into
mdn:mainfrom
kamikkels:patch-1
Oct 2, 2026
Merged

chrisdavidmills merged 7 commits into
mdn:mainfrom
kamikkels:patch-1

Conversation

@kamikkels

Copy link
Copy Markdown
Contributor

Description

Clarified the definition of a scroll container and detailed the behavior of its overflow values. Added information about the scrollport and how content is scrolled.

Motivation

Was looking at flex item behavior with min-width and overflow: 'auto' and the old article wasn't describing what was happening

Additional details

https://www.w3.org/TR/css-overflow-3/#overflow-control

Related issues and pull requests

Clarified the definition of a scroll container and detailed the behavior of its overflow values. Added information about the scrollport and how content is scrolled.
@kamikkels
kamikkels requested a review from a team as a code owner October 1, 2026 00:08
@kamikkels
kamikkels requested review from chrisdavidmills and removed request for a team October 1, 2026 00:08
@github-actions github-actions Bot added Content:Glossary Glossary entries size/s [PR only] 6-50 LoC changed labels Oct 1, 2026

@chrisdavidmills chrisdavidmills left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kamikkels, and thanks for your contribution. I think there are definitely some valid improvements here; I have a few comments for you to consider

- `auto`: scroll bars are shown only when the content overflows the box.
- `hidden`: no scroll bars are shown, and the user can't scroll the content directly, but it can still be scrolled programmatically, for example with {{domxref("Element.scrollTo()")}} or by focusing an element inside it.

Because scroll container status comes from the `overflow` value, it affects layout even when nothing overflows, for example a scroll container that is a flex item has an automatic minimum size of `0`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this line is really relevant to what a scroll container is. put it somewhere else, like maybe https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Styling_basics/Overflow, if isn't covered there already?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably needs to be more clearly worded, but this was more about scroll containers always affecting layout in the same way, regardless of what the content inside is doing, which results in things like captive sticky elements, and the container not sizing to its children

updated to a hopefully clearer description

Comment thread files/en-us/glossary/scroll_container/index.md Outdated
Comment thread files/en-us/glossary/scroll_container/index.md Outdated
kamikkels and others added 2 commits October 2, 2026 09:30
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
Clarified the behavior of scroll containers regarding their overflow values and layout effects.
Comment thread files/en-us/glossary/scroll_container/index.md Outdated
Comment thread files/en-us/glossary/scroll_container/index.md Outdated
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Preview URLs (1 page)

(comment last updated: 2026-10-02 15:05:08)

- Scts as the reference box for descendants with {{cssxref("position")}} set to `sticky`.
- Has an automatic minimum size of 0 when it is a flex or grid item, so it can shrink smaller than its content.

### Scrollport

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
error MD001/heading-increment Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]

@chrisdavidmills chrisdavidmills left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so after a bit of fiddling around and a couple of small edits, this is now ready to merge. Thanks again for your work on this, @kamikkels!

@chrisdavidmills
chrisdavidmills merged commit 1b3149a into mdn:main Oct 2, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:Glossary Glossary entries size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants