Hierarchical Sticky Headings
How can a sticky H2 be "pushed up" by a following sticky H1?
11 Replies
Can you be a bit more specific? Is this when scrolling?
Sorry, yes, when scrolling
I'm not sure if this is what you want. https://codepen.io/chooking/pen/wvZdyvo
Header level 2 should not push up its parent (level 1)..
@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?
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.)...
I've modified the pen. Please take a look
That is what I meant! Thx!
The trick is to make the div's that contain the different header levels nested
Have you seen such a behaviour anywhere ?
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