CKTIS / CSS
scroll-padding-right — right-side scroll inset
scroll-padding-right insets the right edge of a scroll container's optimal viewing region. It does not add ordinary padding.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
scroll-padding-right: auto | <length-percentage [0,∞]>;scroll-padding-right specifies an inward offset from the scrollport's physical right edge. It affects the target region for bringing elements into view, even without snapping; when snapping, it defines the snapport's right edge.
It accepts a nonnegative length, a percentage of the scrollport's width, or auto. The initial auto generally means 0px, but the browser can choose another offset. The property is not inherited.
It neither replaces padding-right nor adds layout space, and does not enable snapping itself. It remains physically right regardless of writing direction. In the example, scroll-snap-type enables snapping and scroll-snap-align: end aligns the cards.
Examples
<!doctype html>
<meta charset="utf-8">
<title>scroll-padding-right</title>
<style>
.scroller {
width: 300px;
overflow-x: auto;
scroll-padding-right: 40px;
scroll-snap-type: x mandatory;
display: flex;
gap: 20px;
}
.card {
flex: 0 0 200px;
height: 80px;
background: lightblue;
scroll-snap-align: end;
}
</style>
<div class="scroller">
<div class="card">A</div>
<div class="card">B</div>
<div class="card">C</div>
</div>Result
A horizontally scrollable row of three cards. At an interior end-aligned snap position, a card's right edge is 40px inside the scrollport's right edge.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.