0

is there any way to scroll above an element? I mean, the following "H3" tag for example:

<h3 class="TEST" id="TEST">TEST</h3>
<p>TEXT</p>

I would like to jump a little above this "TEST" element using HREF:

<a href="#TEST">

like 5px above. is there any way to do it? Thanks

Paul9002
  • 9
  • 2
  • Does this answer your question? [Link to a section of a webpage](https://stackoverflow.com/questions/8424785/link-to-a-section-of-a-webpage) – Abhishek Bhagate Jul 03 '20 at 20:27
  • @Abhishek Thanks, but I have already done an HREF and it works fine, I need to jump a little bit above this element. – Paul9002 Jul 03 '20 at 20:29
  • https://stackoverflow.com/questions/17534661/make-anchor-link-go-some-pixels-above-where-its-linked-to This post helped me. Thanks everyone. – Paul9002 Jul 03 '20 at 20:36

1 Answers1

1

If you set a custom class for this h3

<h3 class="TEST jump" id="TEST">TEST</h3>

then you could add CSS like so:

.jump {
    display: block;
    position: relative;
    top: -250px;
    visibility: hidden;
}
Ron
  • 4,977
  • 1
  • 17
  • 28