It's great to see that you're utilizing Bootstrap in your project. However, it appears that there are quite a few manual styles being applied, which can be excessive when using a CSS framework. The reason your anchors aren't aligning properly at the top of the section is due to the id
's starting at the span instead of the section itself. Make sure to place the id
's on the sections directly.
Additionally, the padding on your sections and margins on headings seem to be causing issues. Instead of going through and cleaning up every instance, consider alternative solutions.
scroll-margin adjusts an element’s snap area, defining where it will be snapped to.
I've applied some scroll-margin-top
on each section, with around 5.5em
appearing to work well in this case.
Your code exceeds the character limit for a stack snippet, so please refer to the CodePen link for a closer look.