Вот HTML -код < /p>
Код: Выделить всё
SOME
AND THERE
< /code>
Вот код CSS < /p>
.parent {
display: flex;
align-items: flex-start;
}
.parent >* {
width: 100%;
}
.child1 {
height: 1000vh;
background-color: cyan;
}
.child2 {
background-color: bisque;
position: relative;
}
.child2 > *{
border: 5px solid black;
}
.first {
height: 500px;
}
.last {
background-color: grey;
position: sticky;
top: 0;
height: 500px;
}
Подробнее здесь: https://stackoverflow.com/questions/755 ... s-expected
Мобильная версия