From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/css/overflow-anchor/index.html | 87 ++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 files/zh-cn/web/css/overflow-anchor/index.html (limited to 'files/zh-cn/web/css/overflow-anchor/index.html') diff --git a/files/zh-cn/web/css/overflow-anchor/index.html b/files/zh-cn/web/css/overflow-anchor/index.html new file mode 100644 index 0000000000..42150355bf --- /dev/null +++ b/files/zh-cn/web/css/overflow-anchor/index.html @@ -0,0 +1,87 @@ +--- +title: overflow-anchor +slug: Web/CSS/overflow-anchor +tags: + - CSS + - CSS Scroll Anchoring +translation_of: Web/CSS/overflow-anchor +--- +
{{CSSRef}}
+ +

overflow-anchor CSS 属性提供一种退出浏览器滚动锚定行为的方法,该行为会调整滚动位置以最大程度地减少内容偏移。

+ +

默认情况下,在任何支持滚动锚定行为的浏览器中都将其启用。因此,仅当您在文档或文档的一部分中遇到滚动锚定问题并且需要关闭行为时,才通常需要更改此属性的值。

+ +

语法

+ +
/* Keyword values */
+overflow-anchor: auto;
+overflow-anchor: none;
+
+/* Global values */
+overflow-anchor: inherit;
+overflow-anchor: initial;
+overflow-anchor: unset;
+
+ +

Values

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

Formal syntax

+ +
{{csssyntax}}
+ +

范例

+ +

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

+ +
body {
+  overflow-anchor: none;
+}
+
+ + + +

规范

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('CSS Scroll Anchoring', '#propdef-overflow-anchor', 'overflow-anchor')}}{{Spec2('CSS Scroll Anchoring')}}Initial definition.
+ +

{{cssinfo}}

+ +

浏览器兼容性

+ + + +

{{Compat("css.properties.overflow-anchor")}}

+ +

See also

+ + + +
+
+
-- cgit v1.2.3-54-g00ecf