Skip to content

Scroll Margins

• 1 min

Prevent anchor links from scrolling behind a sticky header.

#anchor {
scroll-margin-top: 1em;
}

Support

The scroll-margin-top property works in all modern browsers, but has no IE support.