how to adjust the anchor in the specific section?

0

I'm doing a page. web, one page, which I am adding an anchor so that in my menu button goes to the information section, makes the fine anchor, there is a detail that does not position the anchor is the specific section if not a little more up from the previous section how do I solve that?

    
asked by merwil vegas 12.07.2018 в 16:15
source

1 answer

0

you could use jquery. p. ex. if you want to go to the top of an image ...

let position = $("#imagen").offset().top;
$("html, body").animate({
    scrollTop: posicion + "px"
}, 500, function() {
    // ok
});

The best is to make a generic function. But that's the idea.

    
answered by 12.07.2018 в 19:09