CSS overflow-anchor Property

❮ Previous Reference Next ❯

Example

* {
  overflow-anchor: none;
}

Meaning:

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.

Default value:auto
Inherited:No
Animatable:No
Version:CSS3
JavaScript syntax:
object.style.overflowAnchor="auto|none|initial|inherit|revert|revert-layer|unset";



Standard Syntax

overflow-anchor: auto|none|initial|inherit|revert|revert-layer|unset;



Browser Support




Status







Property Values

The following table describes the values of this property:

Value Description
auto The element becomes a potential anchor when adjusting scroll position.
none The element won't be selected as a potential anchor.
initial Sets this property to its default value.
inherit If specified, the associated element takes the computed value of its parent element animation-delay property.
revert Reverts the cascaded value of the property from its current value to the value the property
revert-layer Rollback styles to the ones specified in previous cascade layers.
unset Resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not.



Default CSS Property Values

selectors {
  overflow-anchor: none;
}
❮ Previous Reference Next ❯