DEV Community

Calvin
Calvin

Posted on

Reading Snippets [38 => CSS]

An element that uses Position:sticky; is positioned based on the user's scroll position.

A sticky element toggles between relative and fixed, depending on the scroll position.

It maintains the position until a given offset point is met in the viewport. After the offset position is met, the element sticks in place.

Source:W3 Schools

Discussion (0)