The overflow-anchor CSS property provides a way to opt out browser scroll anchoring behavior, which adjusts scroll position to minimize content shifts.

Scroll anchoring behavior is enabled by default in any browser which supports it. Therefore this property is 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.

Syntax

/* Keyword values */
overflow-anchor: auto;
overflow-anchor: none;

/* Global values */
overflow-anchor: inherit;
overflow-anchor: initial;
overflow-anchor: unset;

Values

auto
Element becomes a potential anchor when adjusting scroll position.
none
Element won't be selected as a potential anchor.

Formal syntax

auto | none

Example

To prevent scroll anchoring in a document, use the overflow-anchor property.

body {
  overflow-anchor: none;
}

Specifications

Specification Status Comment
CSS Scroll Anchoring Module Level 1
The definition of 'overflow-anchor' in that specification.
Editor's Draft Initial definition.

Initial valueauto
Applies toall elements
Inheritedno
Mediavisual
Computed valueas specified
Animation typediscrete
Canonical orderper grammar

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
overflow-anchor
Experimental
Chrome Full support 56Edge No support NoFirefox Full support 66IE No support NoOpera Full support 43Safari No support NoWebView Android Full support 56Chrome Android Full support 56Edge Mobile No support NoFirefox Android Full support 66Opera Android Full support 43Safari iOS No support NoSamsung Internet Android No support No

Legend

Full support  
Full support
No support  
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.

 

See also

 

Document Tags and Contributors

Tags: 
Last updated by: vor0nwe,