Example 1 — Length Inset at the Right
Reserve space at the right so snapped panels clear a trailing band.
<style>
.scroller {
width: 260px;
overflow-x: auto;
display: flex;
scroll-snap-type: x mandatory;
scroll-padding-right: 48px;
}
.panel {
flex: 0 0 240px;
scroll-snap-align: end;
}
</style>
<div class="scroller">
<div class="panel">1</div>
<div class="panel">2</div>
<div class="panel">3</div>
</div> How It Works
- Create a horizontal scroller. Overflow defines the scrollport.
- Snap horizontally.
x mandatorylocks panels on the x-axis. - Align to the end. In LTR,
scroll-snap-align: endaims at the right edge. - Inset that edge.
48pxkeeps snapped panels before the right band.

