DONT ADD ANYTHING HERE!

  1. An element with position:sticky is positioned based on the user's scroll position
  2. A sticky element toggles between relative and fixed, depending on the scroll position
  3. It is positioned relative until a given offset position is met in the viewport - then it "sticks" in place (like position:fixed)
  4. You must specify at least one of top, right, bottom or left for sticky positioning to work
  5. The element is positioned according to the normal flow of the document, and then offset relative to its nearest scrolling ancestor and containing block (nearest block-level ancestor), including table-related elements, based on the values of top, right, bottom, and left (MDN)
  6. A sticky element "sticks" to its nearest ancestor that has a "scrolling mechanism" (created when overflow is hidden, scroll, auto, or overlay), even if that ancestor isn't the nearest actually scrolling ancestor

Example

Notes

Mnemonic

References