aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/overflow-anchor/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/css/overflow-anchor/index.html
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/css/overflow-anchor/index.html')
-rw-r--r--files/zh-cn/web/css/overflow-anchor/index.html87
1 files changed, 87 insertions, 0 deletions
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
+---
+<div>{{CSSRef}}</div>
+
+<p><strong><code>overflow-anchor</code></strong> <a href="/en-US/docs/Web/CSS">CSS</a> 属性提供一种退出浏览器滚动锚定行为的方法,该行为会调整滚动位置以最大程度地减少内容偏移。</p>
+
+<p>默认情况下,在任何支持滚动锚定行为的浏览器中都将其启用。因此,仅当您在文档或文档的一部分中遇到滚动锚定问题并且需要关闭行为时,才通常需要更改此属性的值。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="brush:css no-line-numbers">/* Keyword values */
+overflow-anchor: auto;
+overflow-anchor: none;
+
+/* Global values */
+overflow-anchor: inherit;
+overflow-anchor: initial;
+overflow-anchor: unset;
+</pre>
+
+<h3 id="Values">Values</h3>
+
+<dl>
+ <dt><code>auto</code></dt>
+ <dd>The element becomes a potential anchor when adjusting scroll position.</dd>
+ <dt><code>none</code></dt>
+ <dd>The element won't be selected as a potential anchor.</dd>
+</dl>
+
+<h3 id="Formal_syntax">Formal syntax</h3>
+
+<pre class="syntaxbox">{{csssyntax}}</pre>
+
+<h2 id="范例">范例</h2>
+
+<p>To prevent scroll anchoring in a document, use the <code>overflow-anchor</code> property.</p>
+
+<pre class="brush: css">body {
+ overflow-anchor: none;
+}
+</pre>
+
+<ul>
+</ul>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('CSS Scroll Anchoring', '#propdef-overflow-anchor', 'overflow-anchor')}}</td>
+ <td>{{Spec2('CSS Scroll Anchoring')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<p>{{cssinfo}}</p>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("css.properties.overflow-anchor")}}</p>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/CSS/overflow-anchor/Guide_to_scroll_anchoring">Guide to scroll anchoring</a></li>
+</ul>
+
+<div id="gtx-trans" style="position: absolute; left: 385px; top: 1589px;">
+<div class="gtx-trans-icon"></div>
+</div>