The scroll-padding shorthand insets the optimal viewing region of a scrollport. Snap targets and scroll destinations stop inside that inset instead of flush against the edge.
Not deprecated. Defined with scroll snap, but it applies to any scroll container — even when scroll-snap-type is none. Safari 11–14 had partial support for some scroll types.
Use a percentage.20% is relative to the scrollport height here.
Keep other sides zero.20% 0 0 only insets the top.
Scales with the box. Taller or shorter scrollers change the inset size.
Good for fluid UI. Prefer lengths when matching a fixed header pixel height.
Edge Cases & Pitfalls
Most mistakes come from putting the property on the wrong element.
target
Set it on the scroll container
Panels use scroll-margin. The scroller (or html) uses scroll-padding.
layout
It is not regular padding
Content layout does not shift. Only scroll and snap aiming change.
header
Match fixed header height
For document anchors, set scroll-padding-top on html to the header height so headings stay visible.
snap
Snap makes the effect obvious
You can use it without snap, but snap demos show the inset clearly while scrolling.
Compatibility
Browser Support
scroll-padding is a browser CSS property. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available since Apr 2021
scroll-padding
Chrome 69+, Edge 79+, Firefox 68+, Safari 14.1+, Opera 56+, Samsung Internet 10.1+. Safari 11–14 had partial support. Internet Explorer has no support.
97%Global reach
Google Chrome69+
Full support
Mozilla Firefox68+
Full support
Apple Safari14.1+
Full support
Microsoft Edge79+
Full support
Opera56+
Full support
Samsung Internet10.1+
Full support
Internet ExplorerNo support
Not supported
scroll-paddingWidely supported
Bottom line: Safe for modern sites. Ideal for fixed headers and snap scrollers. Not a server runtime API.
Remember
Key Takeaways
Role: inset the scrollport’s optimal viewing region.
Values:auto, lengths, percentages — 1 to 4 sides like padding.
Initial value:auto per side. Not inherited.
Tip: put it on the scroller; use scroll-margin on the targets.
One line:scroll-padding reserves space inside the scrollport so targets do not hide under edges or headers.
Frequently Asked Questions
It insets the optimal viewing region of a scrollport. Scroll and snap targets stop inside that inset instead of flush against the container edge.
Each longhand starts at auto. The browser usually treats that like 0px, but may choose another offset when appropriate.
scroll-padding is set on the scroll container to inset the scrollport. scroll-margin is set on the target element being scrolled to.
padding changes layout and shifts content. scroll-padding only affects where scrolling and snapping aim inside the scrollport.
No. It is defined with scroll snap, but it applies to any scroll container, including document and fragment scrolling.
It is Baseline and widely available since April 2021: Chrome 69+, Edge 79+, Firefox 68+, Safari 14.1+, Opera 56+. Safari 11–14 had partial support. Internet Explorer does not support it. It is a browser CSS property, not a Node.js feature.