0

So, I'm working on a page implemented with Bootstrap 4 and using anchor/hash-based navigation to take users up and down the page. What I'm unclear about is how to control what is actually in view when the page auto-scrolls to the anchor fragment?

Essentially, what I'm looking to do is somehow ensure that at least the section heading is visible, and more or less aligned to the viewport. I am using a fixed-top navigation bar

So, what determines what is "in frame" when an anchor is clicked and the page scrolls to the anchor location? Is this a question of keeping the anchor elements a certain size? So, in essence, what do I need to do via css or html to get section heading in view when they're clicked?

nizz0k
  • 471
  • 1
  • 8
  • 23
  • Clicking such an anchor simply scrolls the page so that the top corner of the target element aligns with the top of the viewport. (If the page content is long enough, otherwise the target element might end up further down.) – 04FS Oct 07 '19 at 12:52
  • Possible duplicate of [Fixed page header overlaps in-page anchors](https://stackoverflow.com/questions/4086107/fixed-page-header-overlaps-in-page-anchors) – 04FS Oct 07 '19 at 12:52

0 Answers0