CSS overflow-anchor
The overflow-anchor CSS property specifies under what circumstances a scrolling box (container) is scrolled when the user reaches the boundary of the scrollport. This property is useful for ensuring that content stays in view when scrolling.
The overflow-anchor property specifies if an element is used as an anchor to control the scrolling of the scroll container. The anchor is used when the scroll container is scrolled either by the user, by the application, or by an anchor itself.
Here is an example to demonstrate the use of overflow-anchor property: