DEV Community

loading...

Discussion on: The CSS Position Property Explained - with Examples

Collapse
afif profile image
Temani Afif

Sticky deosn't always stick to the viewport but to the nearest ancestor having a scrolling box. A bit trick as concept (related: stackoverflow.com/q/55592104/8620333). In other words, it's the first ancestor with overflow different from visible (that's why overflow:hidden is a hassle for sticky, also related: stackoverflow.com/a/54806576/8620333)

Collapse
christiankozalla profile image
Christian Kozalla Author

You're absolutely right! I didn't know how to phrase it simply, so I omitted the fact..
๐Ÿ‘Thanks!