overflow-anchor

CSS overflow-anchor Property

The overflow-anchor property allows to opt out Scroll Anchoring, a browser feature which adds scroll position to minimize content shifts.

Scroll Anchoring is enabled by default in any supported browser.

This property has two values: auto and none.

类目类目
Initial Valueauto
Applies toAll elements.
InheritedNo.
AnimatableNo.
VersionCSS Scroll Anchoring Module Level 1
DOM Syntaxobject.style.overflowAnchor = “none”;

Syntax

Syntax

overflow-anchor: auto | none | initial | inherit;

You can insert the following piece of code with the overflow-anchor property into your CSS code:

body {
  overflow-anchor: none;
}

Values

Values

ValueDescription
autoAdjustes scroll anchoring position thus making an element an anchor.
noneDisables scroll anchoring making the content reflow.
initialMakes the property use its default value.
inheritInherits the property from its parents element.


请遵守《互联网环境法规》文明发言,欢迎讨论问题
扫码反馈

扫一扫,反馈当前页面

咨询反馈
扫码关注
返回顶部