This solution is great, but do you know the scroll-margin-top property? It is working according to your nav-bar height when on position: sticky. And solve the problem in a more consistent way.
Cheers
I write bit-sized stories about the internet.
Since 2026: Python Developer, into Cyber Security (p0hnk3m0n@TryHackMe)
2020-2025: Accessibility Specialist
This solution is great, but do you know the
scroll-margin-topproperty? It is working according to your nav-bar height when onposition: sticky. And solve the problem in a more consistent way.Cheers
Thank you. I will update the article immediately :)