Anchor link text position

15 Views Asked by At

everyone. I'm making a web page that has a navigation bar with links to section headers on the page. When I click the links, they bring the header to the very top edge of the page. Is there a way to add some space between the top of the page and the header text's position after clicking these links?

I've found this:

#Section_2 {
    scroll-margin-top: 20px;
}

but I would like to avoid specifying individual sections. I don't want to use JavaScript either.

0

There are 0 best solutions below