The overflow-anchor property controls scroll anchoring, which keeps your reading position stable when content above you changes on the page.
01
Scroll Anchoring
Stable scroll view.
02
auto Default
Browser decides.
03
none Value
Disable anchoring.
04
Dynamic Content
Loading & updates.
05
Scroll Containers
Works on overflow.
06
UX Control
Prevent jumps.
Fundamentals
Introduction
The overflow-anchor property in CSS is designed to control the behavior of scroll anchoring, which is a feature that helps maintain the user’s scroll position when content changes dynamically.
This property ensures that the user’s view remains consistent and predictable when elements on the page are resized or added. This is particularly useful for improving the user experience on pages where content is dynamically loaded or updated.
Definition and Usage
Imagine reading a long feed while an image or ad loads above your current position. Scroll anchoring tries to keep the same content in view so the page does not jump unexpectedly.
Use overflow-anchor: none when that automatic adjustment causes problems in a custom scroll area or specialized UI.
💡
Beginner Tip
Most pages work fine with the default auto. You only need none when scroll anchoring interferes with a specific layout behavior.
Foundation
📝 Syntax
The overflow-anchor property can be applied to any scrollable element. The syntax is as follows:
Reduce unexpected movement — Scroll anchoring can help users with vestibular sensitivity by limiting jarring jumps.
Test dynamic updates — Ensure content changes do not hide focused or important information.
Do not disable without reason — Turning off anchoring may reintroduce layout jumps.
Pair with clear loading states — When content shifts, visual feedback helps all users.
🧠 How overflow-anchor Works
1
User scrolls into content
They read or interact partway down a scrollable page or panel.
Scroll
2
Content above changes
Images load, ads appear, or new items are inserted higher in the DOM.
Change
3
Browser adjusts or skips anchoring
auto preserves view stability; none disables that behavior.
Anchor
=
⚗
Predictable scroll experience
Users stay oriented while dynamic content updates around them.
Compatibility
Browser Compatibility
The overflow-anchor property is supported in most modern browsers, including the latest versions of Chrome, Firefox, and Edge. Test your implementation across browsers to ensure consistent behavior.
✓ Baseline · Modern browsers
Good support in current browsers
Scroll anchoring control works in up-to-date Chrome, Firefox, Edge, and Safari versions.
92%Modern browser support
Google Chrome56+ · Desktop & Mobile
Full support
Mozilla Firefox66+ · Desktop & Mobile
Full support
Apple Safari15.4+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Internet ExplorerNo support
None
overflow-anchor property92% supported
Bottom line: Safe to use as progressive enhancement for scroll stability in modern projects.
Wrap Up
Conclusion
The overflow-anchor property is a valuable tool for managing scroll behavior in dynamically updated content.
By controlling whether scroll anchoring is applied, you can create a smoother and more predictable user experience. Whether you choose to use the default automatic anchoring or disable it entirely, this property helps maintain the stability of the user’s view during content changes.