Hierarchical Sticky Headings

How can a sticky H2 be "pushed up" by a following sticky H1?
11 Replies
SvenSplynter
SvenSplynter9mo ago
Can you be a bit more specific? Is this when scrolling?
Tobias Sjögren
Tobias SjögrenOP9mo ago
Sorry, yes, when scrolling
Choo♚𝕂𝕚𝕟𝕘
I'm not sure if this is what you want. https://codepen.io/chooking/pen/wvZdyvo
Tobias Sjögren
Tobias SjögrenOP9mo ago
Header level 2 should not push up its parent (level 1)..
SvenSplynter
SvenSplynter9mo ago
@Tobias Sjögren I think this is what you're looking for then. https://codepen.io/Sven-Joseph/pen/JjVJbqj or perhaps a combination of this with what ChooKing was giving you?
Tobias Sjögren
Tobias SjögrenOP9mo ago
Can you add a H1 below that pushes up both of your H1 and H3 ? Any following equal- or lower-numbered H should push up any previous sticky H (placed above). In ChooKing's example, every H is pushed up by another H regardless of level numbering (H1, H2 etc.)...
SvenSplynter
SvenSplynter9mo ago
I've modified the pen. Please take a look
Tobias Sjögren
Tobias SjögrenOP9mo ago
That is what I meant! Thx!
SvenSplynter
SvenSplynter9mo ago
The trick is to make the div's that contain the different header levels nested
Tobias Sjögren
Tobias SjögrenOP9mo ago
Have you seen such a behaviour anywhere ?
SvenSplynter
SvenSplynter9mo ago
It actually looks pretty familiar, but I can't really say where I've seen it before. I guess it reminds me the most of the sticky header in VS Code
Want results from more Discord servers?
Add your server