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
Even if you fall on your face, you're still moving forward.
Victor Kiam
Random CSS Property

animation-duration

The animation-duration CSS property sets the length of time that an animation takes to complete one cycle.
animation-duration css reference