CSS scroll-margin-block-end Property
Description
The scroll-margin-block-end property defines an extra offset on the element’s end side of the block axis that scrolling and scroll-snapping algorithms take into account. In other words, when the element is brought into view — whether by a user interaction that causes snapping or by a script calling a scroll method — the scrolling logic will position the element as if it had additional space on its block-end edge. Because it is a logical property, which edge is considered the “block end” depends on the element’s writing mode and direction (for example, bottom in typical horizontal writing modes, but different in vertical or right-to-left layouts).
This property does not change the element’s box sizing, paint, or DOM layout; it only influences scroll positioning calculations. That means it won’t affect document flow, hit testing, or how other elements are laid out, but it will change where the element lands when the browser aligns it to the scroll container’s edge. Developers typically use it to ensure scrolled-to content isn’t obscured by fixed or sticky UI (headers, toolbars) or to create consistent visual spacing when elements snap into view. It’s often used alongside snapping-related properties such as scroll-snap-align to fine-tune the final aligned position.
Conceptually, scroll-margin-block-end acts like a scroll-only “buffer” on the element’s block-end side. It applies relative to the relevant scroll container (usually the nearest ancestor that actually scrolls) and composes with other logical scroll margin properties and shorthands, for example scroll-margin or the opposing side scroll-margin-block-start, to produce the effective scroll offset. For container-level adjustments to where the scrolling viewport treats its edges, the related property scroll-padding is useful; combining these tools lets you reliably control both the container’s visible inset and how individual items are positioned when brought into view.
Definition
- Initial value
- 0
- Applies to
- all elements
- Inherited
- no
- Computed value
- as specified
- Animatable
- by computed value type
- JavaScript syntax
- object.style.scrollMarginBlockEnd
Interactive Demo
Syntax
scroll-margin-block-end: <length>
Values
- <length>An outset from the block end edge of the scroll container.
Example
Browser Support
The following information will show you the current browser support for the CSS scroll-margin-block-end property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
