Code: Select all
.slider {
width: 100%;
position: relative;
overflow: auto;
}
.header,
.body {
display: flex;
}
.item {
width: 20%;
height: 100px;
background: yellow;
border: 1px solid black;
flex-grow: 0;
flex-shrink: 0;
}
.sticky-item-left {
position: sticky;
left: 0;
background: red;
}
.sticky-item-right {
position: sticky;
right: 0;
background: green;
}< /code>
Mobile version