The scroll-padding-block property insets the scrollport on the block axis inside a scroll container. It is the logical companion to physical top/bottom scroll padding and works well with scroll snapping.
01
block
Vertical flow axis.
02
start
Block-start side.
03
end
Block-end side.
04
snap
Scroll snapping.
05
length
px, rem, %.
06
logical
Writing-mode safe.
Fundamentals
Introduction
The scroll-padding-block property in CSS is a shorthand property that sets the scroll padding of a scroll container in the block dimension.
This property defines the space between the snap position and the edges of the scroll container on the block axis (top and bottom in horizontal writing mode, or the corresponding sides in vertical writing modes). It is part of the CSS Scroll Snap module and helps create a better scroll snapping experience.
Definition and Usage
scroll-padding-block is a logical shorthand for scroll-padding-block-start and scroll-padding-block-end. Apply it to the scroll container — such as html or an element with overflow: auto and scroll-snap-type.
In standard horizontal writing mode, block-start maps to the top and block-end maps to the bottom. That makes scroll-padding-block: 4rem 1rem similar to setting top and bottom scrollport insets, but it stays correct if the writing mode changes.
💡
Beginner Tip
On a normal English webpage, think of scroll-padding-block as “top and bottom scrollport inset” that follows the document’s block direction.
Foundation
📝 Syntax
The syntax for the scroll-padding-block property is straightforward. It can accept one or two values.
If one value is specified, it applies the same inset to both block-start and block-end.
If two values are specified, the first applies to block-start and the second to block-end.
Basic Example
scroll-padding-block.css
.scroll-container{scroll-padding-block:20px;}
Longhand Properties
scroll-padding-block-start — inset at the block-start edge
scroll-padding-block-end — inset at the block-end edge
Syntax Rules
One value sets both block-start and block-end equally.
Two values set block-start first, then block-end.
Percentages are relative to the scroll container’s block size.
Set the inset on the scroll container, not on individual snap targets.
Defaults
🎯 Default Value
The default value for the scroll-padding-block property is auto, which means no extra block-axis inset is applied unless you specify a length or percentage.
For inline-axis insets, use scroll-padding-inline instead.
Preview
👀 Live Preview
Scroll inside the panel. The container uses scroll-snap-type: y mandatory and scroll-padding-block: 12px.
Section 1
Section 2
Section 3
The block-axis inset creates breathing room when each panel snaps inside the scrollport.
Hands-On
Examples Gallery
Start with the reference scroll-snap example, set different block-start and block-end values, try a scroll container, and use scroll-padding-block-start with a sticky header.
📜 Block-Axis Scrollport Inset
Inset the scrollport on the block axis inside a scroll container — matching the reference example.
Example 1 — scroll-padding-block with scroll snap
In this example, we’ll apply scroll padding to a container so items snap with padding from the top and bottom edges.
The page scrollport leaves extra space at block-start to clear a fixed header.
How It Works
Longhands let you inset only one logical side of the scrollport when the other side does not need adjustment.
Companion
scroll-padding-block vs scroll-padding
scroll-padding is the physical shorthand for all four sides. scroll-padding-block targets only the block axis and is safer for multilingual layouts.
Pair with scroll-behavior: smooth for animated anchor navigation and with scroll-snap-align for snapped carousels or section scrollers.
logical-vs-physical.css
/* Physical shorthand */.physical{scroll-padding-top:4rem;}/* Logical equivalent in horizontal writing */.logical{scroll-padding-block-start:4rem;}
🧠 How scroll-padding-block Works
1
Block axis is determined
Writing mode decides which container edges are block-start and block-end.
Logical
2
Scrollport edges inset
scroll-padding-block shrinks the effective snap area on both block edges of the container.
Inset
3
Content snaps into place
Snapped items land inside the inset scrollport instead of flush against block edges.
Position
=
★
Comfortable block-axis snaps
Snapped content stays visible, even with fixed headers on the block-start side.
Compatibility
Browser Compatibility
The scroll-padding-block 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.
✓ Logical scroll padding · Modern support
Reliable scroll-padding-block support
Current Chrome, Firefox, Safari, Edge, and Opera support logical scroll-padding properties.
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 scroll snapping on iOS Safari to confirm block-start inset clears your fixed header height.
scroll-padding-block property97% supported
Bottom line:scroll-padding-block is widely supported in modern browsers for scroll containers and snap layouts.
Wrap Up
Conclusion
The scroll-padding-block property is a useful tool for enhancing the scroll snapping experience on your web pages.
By defining padding in the block direction on a scroll container, you can create smoother and more visually appealing scroll behavior. Experiment with different padding values to see how this property can improve the user experience on your site.
Prefer logical scroll-padding-block for international layouts
Apply it to the element that actually scrolls
Pair with scroll-snap-type on the same container
Match block-start inset to fixed header height
Test vertical snap panels on mobile browsers
❌ Don’t
Confuse scroll-padding-block with regular padding-block
Apply it to snap targets instead of the scroll container
Assume block-start always means top in every writing mode
Forget inline-axis inset when content needs side padding
Use huge percentage values without testing small screens
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about scroll-padding-block
Use these points when insetting block-axis scroll containers.
5
Core concepts
★01
auto Default
No inset.
Default
⚙02
block axis
Logical flow.
Axis
◉03
start / end
Two sides.
Values
▦04
snap
Scroll snapping.
Use case
🔄05
longhands
block-start.
Detail
❓ Frequently Asked Questions
scroll-padding-block sets scrollport inset on the block axis — block-start and block-end — inside a scroll container. In normal horizontal writing mode, that usually means top and bottom.
scroll-padding is the physical shorthand for all four sides. scroll-padding-block is a logical shorthand that insets only the block axis, which adapts correctly in vertical writing modes.
They are logical directions. In horizontal left-to-right writing, block-start is the top and block-end is the bottom. In vertical writing modes, they map to the corresponding block flow sides.
The default value is auto, meaning the browser applies no extra block-axis inset unless you specify a length, percentage, or other value.
Use it on scroll containers when you want block-axis scrollport insets that work with logical layout, especially with scroll snapping and vertically flowing content.