just use this in your css:
html { scroll-behavior: smooth; }
I was sad when safari didn't accept that.
And to compensate for the offset -100. The element you wish to scroll to needs: scroll-margin-top: -100px
That CSS property is also great but it won't be that customizable and perfect :)
It is not fully supported by Safari, only with an experimental flag
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
just use this in your css:
html {
scroll-behavior: smooth;
}
I was sad when safari didn't accept that.
And to compensate for the offset -100.
The element you wish to scroll to needs: scroll-margin-top: -100px
That CSS property is also great but it won't be that customizable and perfect :)
It is not fully supported by Safari, only with an experimental flag