How to change the offset when Autoscroll to a certain html element?

There is an element on the page, some with id="id", the server redirects to the url.com#id. Autoscroll correctly would have looked, if not fixed at the top of the menu screen with a height of 10px. Accordingly, I need to take Autoscroll to 10px. Is this possible? Now this menu covers a part of the element which is Autoscroll.
April 3rd 20 at 18:31
1 answer
April 3rd 20 at 18:33
Or add margin top for id="id". that certainly would not be very nice on the design.
Or use js
how to use js? - shawna.DuBuque commented on April 3rd 20 at 18:36

Find more questions by tags CSSJavaScriptHTML