I have an anchor link in the footer that, when clicked, scrolls to an anchor in the middle of the page. The issue I'm facing is that despite adding padding to the anchor, it still aligns with the top of the browser without any grip from the padding. When inspecting the element, I can see the padding expanding beyond the containing div.
What could be causing this?
CSS
<style>
.anchor-link {
margin: -90px 0 0;
padding: 90px 0 0;
display:block;
}
</style>
HTML
<div class="anchor">
<h2>
<a name="A" class="anchor-link">This is the anchor</a>
</h2>
</div>