CKTIS / CSS
scroll-padding-inline-end — inline-end viewing offset
The scroll-padding-inline-end property defines an inward offset for a scroll container's optimal viewing region at its inline-end edge, without changing content layout.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
scroll-padding-inline-end: auto | <length-percentage [0,∞]>;scroll-padding-inline-end sets an offset from a scroll container's logical inline-end edge. The edge depends on writing direction: in this example it is the right side. The offset reduces the region used for scrolling alignment, but does not add ordinary padding or change layout.
It accepts auto or a nonnegative length or percentage. Percentages refer to the corresponding scrollport dimension. The initial auto usually means 0px, but the browser may choose another offset. The property is not inherited.
It does not enable snapping; use scroll-snap-type for that. It can also affect scrollIntoView(). Set it on the container, whereas scroll-margin-inline-end concerns the target element.
In the example, click Align B. The expected 140 represents a scroll offset that leaves 40 CSS pixels between B's right edge and the scrollport's right edge.
Examples
<!doctype html>
<meta charset="utf-8">
<title>scroll-padding-inline-end</title>
<style>
#scroller {
width: 300px;
overflow-x: auto;
writing-mode: horizontal-tb;
direction: ltr;
scroll-padding-inline-end: 40px;
}
.track { display: flex; width: 900px; }
.item { flex: 0 0 200px; height: 80px; background: lightgray; }
#target { background: lightblue; }
</style>
<div id="scroller" tabindex="0">
<div class="track">
<div class="item">A</div>
<div class="item" id="target">B</div>
<div class="item">C</div>
</div>
</div>
<button id="align" type="button">Align B</button>
<output id="result"></output>
<script>
const scroller = document.querySelector('#scroller');
const target = document.querySelector('#target');
document.querySelector('#align').addEventListener('click', () => {
target.scrollIntoView({ behavior: 'instant', block: 'nearest', inline: 'end' });
document.querySelector('#result').textContent = String(scroller.scrollLeft);
});
</script>Result
140
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.