{"id":336045,"date":"2021-03-15T14:53:29","date_gmt":"2021-03-15T21:53:29","guid":{"rendered":"https:\/\/css-tricks.com\/?page_id=336045"},"modified":"2021-07-09T08:11:05","modified_gmt":"2021-07-09T15:11:05","slug":"205-sticky-positioning-how-it-works-what-can-break-it-and-dumb-tricks","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/video-screencasts\/205-sticky-positioning-how-it-works-what-can-break-it-and-dumb-tricks\/","title":{"rendered":"#205: Sticky Positioning: How it Works, What Can Break It, and Dumb Tricks"},"content":{"rendered":"

How it works<\/h3>\n\n\n

You apply position: sticky;<\/a><\/code> to an element along with a top<\/code>, left<\/code>, right<\/code>, or bottom<\/code> threshold and it will “stick” in that position when the threshold is passed, as long as there is room to move within the parent container.<\/p>\n\n\n\n