scroll-margin-block
Widely availableSince 202197% of users
A shorthand that sets both the start and end scroll margins at the same time. It creates a 'snap buffer' in the vertical direction (or whatever the 'block' axis is).
What's modern
From web-features, MDN's browser data and our snippets, checked dailyModernIn every major browser since September 2021. Widely available since March 2024.
See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
See individual properties- Inherited
- No
- Applies to
- all elements
- Animation type
- byComputedValueType
Quick example
h2 {
/* Adds a 2rem buffer on both the top and bottom when snapping to this header */
scroll-margin-block: 2rem;
}scroll-margin-block browser support
BaselineWidely availableThis feature is well established and works across many devices and browser versions. It has been available across browsers since 2021.Safe to use without fallbacks.
Usage97%of people can use this3% use a browser without it.
Browsers
69+
68+
15+
79+Mobile
69+Android
68+Android
15+iOS
Interop 2026 focus area. All major browsers are actively working to fix cross-browser inconsistencies for this feature in 2026. Learn more →