<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>
.kapsayici {
display: flex;
gap: 5px;
height: 150px;
width: 300px;
border: 1px solid black;
scroll-snap-type: x proximity;
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: end;
}
.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);
}
@import url('https://fonts.googleapis.com/css?family=Merriweather+Sans:300,800');
body {
font-family: 'Merriweather Sans', sans-serif;
width: 550px;
margin-inline: auto;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.