I've made a link to jump to a part of another page using the following HTML:
<a href="./about-us.html#our-mission"> Read more »</a>
This is the id of the link where it goes to:
<div id="our-mission" name="our-mission">
The problem is that it is dropping me a few lines down from the heading "Our Mission" on the targeted page.
How do I get it to target the correct spot, please? Tnx.
CodePudding user response:
I guess you need to set an offset. You sould try something like this:
https://css-tricks.com/hash-tag-links-padding/
offsetting an html anchor to adjust for fixed header
CodePudding user response:
Try adding this to your CSS file:
#our-mission {padding-top:3%;}
Adjust percentage as needed.