Pure CSS Scroll-To Padding

blog cover image
1
85 followers

Check out this sweet css trick. In your additional css for universal, or snippets for page only. Offset scrolling to any item anchor or otherwise.

html {
--top-spacing: 125px;
scroll-padding-top: var(--top-spacing);
}

Have fun

Login
Create Your Free Wealthy Affiliate Account Today!
icon
4-Steps to Success Class
icon
One Profit Ready Website
icon
Market Research & Analysis Tools
icon
Millionaire Mentorship
icon
Core “Business Start Up” Training

Recent Comments

4

Awesome!
Have you ever used it?

its working perfectly on html anchors with a sticky header and 125px offset

Thank you for letting me know

I did some thorough research this seems to be the best way out of the few that exist. found it on css-tricks.com

See more comments

Login
Create Your Free Wealthy Affiliate Account Today!
icon
4-Steps to Success Class
icon
One Profit Ready Website
icon
Market Research & Analysis Tools
icon
Millionaire Mentorship
icon
Core “Business Start Up” Training