Ask Your Question
2

How can I make the html anchor link jump further?

asked 2022-01-14 11:00:00 +0000

ladyg gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-03-10 08:00:00 +0000

woof gravatar image

To make the HTML anchor link jump further, you can add an offset value to the anchor link. This is achieved by adding a negative margin to the element that you want the page to scroll to when the anchor link is clicked.

For example, if you have an anchor link to a section with the ID "section2" and you want to jump 50 pixels further down the page to that section, you can add the following CSS code:

section2 {

margin-top: -50px; }

This will make the page scroll 50 pixels further down when the anchor link to that section is clicked. Adjust the margin value to the desired distance you want to jump.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-01-14 11:00:00 +0000

Seen: 12 times

Last updated: Mar 10 '22