Created
January 10, 2024 00:22
-
-
Save robspangler/196d4507600a6480b8d11a344899afa8 to your computer and use it in GitHub Desktop.
Pure CSS smooth scrolling with an optional offset (for fixed headers, for example)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { | |
scroll-behavior: smooth; | |
} | |
#section-id { | |
scroll-margin-top: 100px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment