1

I want to move to a specific section on click, and I am doing that using <a name="updates"></a> and <a href="#updates">Updates</a>. However, when I move to that section, the title of the section is not visible since it is hidden by the persistent header with z-index: 99 (so it is always above all the other content). I would like to move a few pixels up so the title is visible when I click to move to that section.

I tried positioning the <a name="updates"></a> in a div that is rendered before the updates div, but that is not the proper solution, and makes the code confusing to read.

// Moving here
<a name="updates"></a>
...
// Link used to move there
<a href="#updates">Updates</a>
sohinim98
  • 82
  • 2
  • 11
  • Can you add padding the target, enough to make it visible? For example: #updates { padding-top: 50px; } – BattlFrog Jun 11 '19 at 17:56
  • Not really. I don't want to change the current structure/css of the page. So maybe a javascript solution? – sohinim98 Jun 11 '19 at 19:29
  • How about this solution: https://stackoverflow.com/questions/17534661/make-anchor-link-go-some-pixels-above-where-its-linked-to – BattlFrog Jun 11 '19 at 19:40

0 Answers0