overflow-anchor
Quick Summary for overflow-anchor
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.
Code Usage for overflow-anchor
/* Keyword values */ overflow-anchor: auto; overflow-anchor: none;  /* Global values */ overflow-anchor: inherit; overflow-anchor: initial; overflow-anchor: revert; overflow-anchor: unset; 
More Details for overflow-anchor

overflow-anchor

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.

Syntax

/* Keyword values */ overflow-anchor: auto; overflow-anchor: none;  /* Global values */ overflow-anchor: inherit; overflow-anchor: initial; overflow-anchor: revert; 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 definition

Initial valueauto
Applies toall elements
Inheritedno
Computed valueas specified
Animation typediscrete

Formal syntax

auto | none

Examples

Prevent scroll anchoring

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

* {   overflow-anchor: none; } 

Specifications

Specification
CSS Scroll Anchoring Module Level 1 # exclusion-api

See also

Guide to scroll anchoring

Last modified: Aug 12, 2021, by MDN contributors

Select your preferred language English (US)Français日本語中文 (简体) Change language

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
"Let us prepare our minds as if we'd come to the very end of life. Let us postpone nothing. Let us balance life's books each day ... The one who puts the finishing touches on their life each day is never short of time."
Seneca
Random CSS Property

caret-color

The caret-color CSS property sets the color of the insertion caret, the visible marker where the next character typed will be inserted. This is sometimes referred to as the text input cursor. The caret appears in elements such as <input> or those with the contenteditable attribute. The caret is typically a thin vertical line that flashes to help make it more noticeable. By default, it is black, but its color can be altered with this property.
caret-color css reference