Before posting this, I reviewed the following discussions/websites on this topic:
But I still do not get how negative margins work. Or rather, they are not working the way I think they should based on my understanding.
Specifically, I am using negative margins to ensure that each section does not get covered by fixed navbar when I scroll to that section via links in navbar.
[CodePen here: https://codepen.io/sabahatiqbal/pen/EpPvZb]
I understand setting the height of span = height of navbar so that the next element (i.e. the section I am trying to show) is not hidden by navbar. But then I dont get why the margin-top has to be set to negative 92.
Won’t that push my hidden up by 92 points…which will negate the fact the height code…?