The overflow-anchor
CSS property provides a way to opt out of the browser's scroll anchoring behavior, which adjusts scroll position to minimize content shifts.
Scroll anchoring behavior is enabled by default in any browser that supports it. Therefore, changing the value of this property is typically only required if you are experiencing problems with scroll anchoring in a document or part of a document and need to turn the behavior off.
/* Keyword values */ overflow-anchor: auto; overflow-anchor: none; /* Global values */ overflow-anchor: inherit; overflow-anchor: initial; overflow-anchor: unset;
auto
none
Initial value | auto |
---|---|
Applies to | all elements |
Inherited | no |
Computed value | as specified |
Animation type | discrete |
auto | none
To prevent scroll anchoring in a document, use the overflow-anchor
property.
* { overflow-anchor: none; }
Specification | Status | Comment |
---|---|---|
CSS Scroll Anchoring Module Level 1 The definition of 'overflow-anchor' in that specification. | Editor's Draft | Initial definition. |
Desktop | ||||||
---|---|---|---|---|---|---|
overflow-anchor |
56 | 79 | 66 | No | 43 | No |
Mobile | ||||||
---|---|---|---|---|---|---|
overflow-anchor |
56 | 56 | No | 43 | No | 6.0 |
© 2005–2020 Mozilla and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-anchor