Learn how to create a sticky element with CSS.
Read on how to do it in this tutorial: https://www.w3schools.com/howto/howto_css_sticky_element.asp
Try it yourself here: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_sticky_element
To learn more about CSS positioning, read our CSS Position tutorial.