The scroll-margin-bottom property adds bottom scroll offset to a target element. It is especially useful in scroll-snap layouts and when footer sections should not sit flush against the viewport bottom.
01
bottom
Physical edge.
02
offset
Scroll stop space.
03
snap
Scroll snapping.
04
footer
End sections.
05
length
px, rem, %.
06
target
On element.
Fundamentals
Introduction
The scroll-margin-bottom property in CSS is used to set the bottom scroll offset of an element when it is scrolled into view.
This property is part of the CSS Scroll Snap module and is widely used to control how close an element sits to the bottom edge of a scroll container when it snaps or becomes a scroll target. By using scroll-margin-bottom, you can keep elements a comfortable distance from the container’s bottom edge.
Definition and Usage
Apply scroll-margin-bottom to the element being scrolled to — snap items, footer sections, cards, or any anchor target.
It also works outside pure snap layouts: anchor links, scrollIntoView(), and keyboard focus scrolling all respect bottom scroll margin on the target.
💡
Beginner Tip
On a normal horizontal webpage, scroll-margin-bottom is similar to scroll-margin-block-end, but always refers to the physical bottom edge.
Foundation
📝 Syntax
The syntax for the scroll-margin-bottom property is straightforward and allows you to specify a length value.
syntax.css
element{scroll-margin-bottom:value;}
Here, value can be any valid CSS length unit such as px, em, rem, %, etc.
The last card snaps with visible space below it in the scroller.
How It Works
You often only need bottom offset on the final item in a vertical snap list.
Companion
scroll-margin-bottom vs logical properties
scroll-margin-bottom is a physical side property. In horizontal writing mode it often matches scroll-margin-block-end. For international layouts, prefer logical properties when the block axis may change.
See also the shorthand scroll-margin when you need offsets on multiple sides at once.
A snap rule, anchor link, or script focuses on an element with bottom scroll margin.
Target
2
Bottom snap area grows
scroll-margin-bottom adds offset below the element’s box for scroll positioning.
Offset
3
Scroll position settles
The element lands with the requested space above the container or viewport bottom.
Position
=
★
Comfortable bottom stops
Snapped items and footer targets no longer feel cramped against the edge.
Compatibility
Browser Compatibility
The scroll-margin-bottom property is supported in most modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. However, it is always a good practice to test your website across different browsers to ensure compatibility.
✓ Scroll margins · Modern support
Reliable bottom scroll-margin support
Current Chrome, Firefox, Safari, Edge, and Opera support scroll-margin-bottom.
97%Modern browser support
Google Chrome69+ · Desktop & Mobile
Full support
Mozilla Firefox68+ · Desktop & Mobile
Full support
Apple Safari14.1+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera56+ · Modern versions
Full support
Testing tip
Test snap lists and footer anchor jumps on mobile browsers to confirm the bottom offset feels right.
scroll-margin-bottom property97% supported
Bottom line:scroll-margin-bottom is widely supported for scroll snap and in-page navigation in modern projects.
Wrap Up
Conclusion
The scroll-margin-bottom property is a useful tool for web developers looking to enhance the user experience by controlling the scroll position of elements.
By customizing the bottom margin for scroll snapping and scroll targets, you can ensure that elements are positioned exactly where you want them when they come into view. Experiment with different values to see how this property can improve the usability and aesthetics of your web projects.
Apply scroll-margin-bottom on scroll target elements
Use it on the last item in vertical snap lists
Pair footer targets with scroll-behavior: smooth
Test with scrollIntoView() inside overflow containers
Consider logical scroll-margin-block-end for i18n layouts
❌ Don’t
Confuse it with regular margin-bottom layout spacing
Set it on the scroll container expecting padding
Assume it only works with scroll snapping
Forget top offset when sticky headers cover titles
Use huge percentage values without testing small screens
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about scroll-margin-bottom
Use these points when offsetting bottom scroll targets.
5
Core concepts
★01
0 Default
No offset.
Default
⚙02
bottom
Physical edge.
Side
◉03
snap
Common use.
Pattern
▦04
footer
End links.
Use case
🔄05
block-end
Logical twin.
Companion
❓ Frequently Asked Questions
scroll-margin-bottom adds scroll offset at the bottom edge of an element when it is scrolled into view. It helps prevent targets from sitting flush against the bottom of the viewport or scroll container.
No. It works with scroll snapping, anchor links, focus navigation, and scrollIntoView(). Snap layouts are a common use case, but not the only one.
scroll-margin-bottom is a physical property that always targets the bottom edge. scroll-margin-block-end is logical and follows the block axis, which may map differently in vertical writing modes.
The default value is 0, meaning no extra bottom offset is applied.
Use it when a scroll target near the bottom needs breathing room, such as the last snap panel, a footer anchor target, or an element scrolled to with JavaScript.