How it works
You apply position: sticky; to an element along with a top, left, right, or bottom threshold and it will “stick” in that position when the threshold is passed, as long as there is room …
position: sticky;
top
left
right
bottom
See All 211 Episodes of "CSS-Tricks Screencasts"