Sooo, I’m currently trying to improve my documentation project (https://codepen.io/scissorsky/pen/mdLPKGK) and I’m happy with the desktop version, I’m just not happy with what it looks like on smaller screens.
one possibility is to use the @media to set an appropriate margin for the content you are jumping to (so as to push it down on search screens).
Another might be to use a grid layout so that the navigation always takes the first row and the content the remainder.
You can use scroll-padding-top to offset the fixed nav. It needs to be on the scroll container. The value you set is basically the height of the nav.
The margin solution didn’t work, but somebody else mentioned scroll-padding-top and that did the trick. I really appreciate your help, though. Thanks a lot!
It worked, Thank you so much! I was losing my mind because I didn’t know what exactly to look for.
It is a super handy property, made just for this.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.