Example 1 — Length Inset at the Left
Reserve space at the left so snapped panels clear a sidebar band.
<style>
.scroller {
width: 260px;
overflow-x: auto;
display: flex;
scroll-snap-type: x mandatory;
scroll-padding-left: 48px;
}
.panel {
flex: 0 0 240px;
scroll-snap-align: start;
}
</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 start. In LTR,
scroll-snap-align: startaims at the left edge. - Inset that edge.
48pxkeeps snapped panels after the left band.

