div.{
position: sticky;
top:0px
}
Video Summary
In this lesson, we’re going to cover the position proper position property with a value sticky. So this has been used for navigational menus. So say you had an element at the top and you scroll down and you want to keep that menu up at the top. This is where the sticky position comes in. And note that when you’re using the sticky position, you can’t use left bottom or right for the side placement for this sticky value. Here we’ll use at a top because this is basically made so for a cool feature so that way, no matter where your web pages are scrolling, your menu will eventually stick at the top. So with that being said, I think we should hop over to code pen and start playing around with this value.