--- title: overflow-anchor slug: Web/CSS/overflow-anchor tags: - CSS - CSS Property - CSS Scroll Anchoring - CSS スクロールアンカリング - CSS プロパティ - Reference - overflow-anchor - スクロールアンカリング translation_of: Web/CSS/overflow-anchor --- <div>{{CSSRef}}</div> <p><strong><code>overflow-anchor</code></strong> は <a href="/ja/docs/Web/CSS">CSS</a> のプロパティで、コンテンツの移動を最小化するためにスクロール位置を調整する、ブラウザーのスクロールアンカリングの動作をオプトアウトする方法を提供します。</p> <p>スクロールアンカリングの動作は、対応しているすべてのブラウザーで既定で有効になっています。したがって、このプロパティを変更するのは通常、文書または文書の一部でスクロールアンカリングによって操作上の問題が発生し、この動作をオフにする必要がある場合のみです。</p> <h2 id="Syntax" name="Syntax">構文</h2> <pre class="brush:css no-line-numbers">/* キーワード値 */ overflow-anchor: auto; overflow-anchor: none; /* グローバル値 */ overflow-anchor: inherit; overflow-anchor: initial; overflow-anchor: unset; </pre> <h3 id="Values" name="Values">値</h3> <dl> <dt><code>auto</code></dt> <dd>その要素は、スクロール位置を調整するときにアンカー候補になります。</dd> <dt><code>none</code></dt> <dd>その要素はアンカー候補として選択されません。</dd> </dl> <h3 id="Formal_syntax" name="Formal_syntax">形式文法</h3> {{csssyntax}} <h2 id="Example" name="Example">例</h2> <p>文書内でスクロールアンカリングを抑止する場合は、 <code>overflow-anchor</code> プロパティを使用してください。</p> <pre class="brush: css">body { overflow-anchor: none; } </pre> <ul> </ul> <h2 id="Specifications" name="Specifications">仕様書</h2> <table class="standard-table"> <thead> <tr> <th scope="col">仕様書</th> <th scope="col">状態</th> <th scope="col">備考</th> </tr> </thead> <tbody> <tr> <td>{{SpecName('CSS Scroll Anchoring', '#propdef-overflow-anchor', 'overflow-anchor')}}</td> <td>{{Spec2('CSS Scroll Anchoring')}}</td> <td>初回定義</td> </tr> </tbody> </table> <p>{{cssinfo}}</p> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> <p>{{Compat("css.properties.overflow-anchor")}}</p> <h2 id="See_also" name="See_also">関連項目</h2> <ul> <li><a href="/ja/docs/Web/CSS/overflow-anchor/Guide_to_scroll_anchoring">スクロールアンカリングの</a>紹介</li> </ul>