Questions tagged [scroll-margin-top]
4 questions
10
votes
1 answer
The scroll-margin-top property doesn't work when using a container with `overflow: hidden`
I have a problem with the css property scroll-margin-top (adds offset when scrolling to element on page). It's not working in all the cases, in particular, this case: when the elements with scroll-margin-top are inside a container with overflow:…

skalta
- 1,033
- 1
- 7
- 18
2
votes
2 answers
How does the CSS property "scroll-margin-top" and "scroll-padding-top" really works
At first, it looks simple, and at the end of scroll event, a margin (or padding) will be applied at the top.
This is useful when there is a sticky element at the top. Then when a link is clicked and scroll down to somewhere on the page, it's nice to…

TigrouMeow
- 3,669
- 3
- 27
- 31
1
vote
2 answers
scroll-margin-top not working on textarea in chrome based browsers
On my page I have a fixed navigation bar, so I am using scroll-margin-top to avoid anchored jump targets to disappear behind the navigation bar.
This is working fine with all elements, except for

arnep
- 5,971
- 3
- 35
- 51
0
votes
1 answer
Pure CSS in-page anchoring with dynamic height sticky header issues
I'm attempting to combine a Pure CSS in page anchoring solution using scroll-behavior: smooth and scroll-margin-top settings, with a position sticky header in-page navigation.
Using IntersectionObserver, I detect the top of the sticky element and…

lscmaro
- 995
- 8
- 22