I'd like to aim navigation links at various points on a single page, and have them land visible below a sticky navigation bar at the top. I can do something like this:
:target { margin-top: 300px; }
But if the user scrolls back up from the target position, there is an empty gap between the target element and the previous element. I'd like to avoid that, but I'm having trouble determining how. Any help would be appreciated.
2.1m questions
2.1m answers
60 comments
57.0k users