CSS · Properties — CSS Scroll Snap

scroll-margin-top

The CSS scroll-margin-top property. Initial value: 0. Not inherited.

Syntax
scroll-margin-top: <length>

Example

Try it

Notes

Media: visual. Applies to: allElements. Computed value: asSpecified.

More in this group

scroll-initial-target scroll-margin scroll-margin-block scroll-margin-block-end scroll-margin-block-start scroll-margin-bottom scroll-margin-inline scroll-margin-inline-end

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course