<h2>scroll-snap-align: start</h2>
<div class="kapsayici">
    <div class="box">S</div>
    <div class="box">C</div>
    <div class="box">R</div>
    <div class="box">O</div>
    <div class="box">L</div>
    <div class="box">L</div>
</div>

<h2>scroll-snap-align: center</h2>
<div class="kapsayici center">
    <div class="box">S</div>
    <div class="box">C</div>
    <div class="box">R</div>
    <div class="box">O</div>
    <div class="box">L</div>
    <div class="box">L</div>
</div>

<h2>scroll-snap-align: end</h2>
<div class="kapsayici end">
    <div class="box">S</div>
    <div class="box">C</div>
    <div class="box">R</div>
    <div class="box">O</div>
    <div class="box">L</div>
    <div class="box">L</div>
</div>
.kapsayici {
  display: flex;
  gap: 5px;
  height: 150px;
  width: 340px;
  border: 1px solid black;
  scroll-snap-type: x mandatory;
  overflow-x: scroll;
  overflow-y: hidden;
}

.box {
  flex: none;
  height: 80px;
  width: 300px;
  font-size: 25px;
  text-align: center;
  line-height: 80px;
  color: #fff;
  background: oklch(0.74 0.18 49.46);
  scroll-snap-align: start;
}
.box:nth-of-type(2) {
  background: oklch(0.59 0.22 9.02);
}
.box:nth-of-type(3) {
  background: oklch(0.91 0.15 194.85);
}
.box:nth-of-type(4) {
  background: oklch(0.92 0.23 128.9);
}
.box:nth-of-type(5) {
  background: oklch(0.64 0.19 256.9);
}
.box:nth-of-type(6) {
  background: oklch(0.79 0.23 147.21);
}

.center .box {
  scroll-snap-align: center;
}

.end .box {
  scroll-snap-align: end;
}
















@import url('https://fonts.googleapis.com/css?family=Merriweather+Sans:300,800');

body {
  font-family: 'Merriweather Sans', sans-serif;
  width: 340px;
  margin-inline: auto;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.