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
Interesting...

Me
Random CSS Property

grid-row-end

The grid-row-end CSS property specifies a grid item's end position within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-end edge of its grid area.
grid-row-end css reference