Archived topic
Making One Widget In A Sidebar Sticky
5 replies · Started by Jodie on August 3, 2022
Hi folks,
I've tried using the code you've already given to make the sidebar sticky, however I want to make the last element sticky.
I tried the code here but unfortunately it doesn't work. Any tips?
Thanks!
Cheers Jodie
Hi Jodie,
Are you still using the Float system?
Perhaps you can try updating to the flexbox system and try the code again?
It would be good to take a backup of your site before doing so.
Reference: https://docs.generatepress.com/article/switching-from-floats-to-flexbox/
Hi Fernando,
Thanks for that. My site uses the Flexbox system, and I tried the code again, but it doesn't work.
This is the code I'm using.
.inside-right-sidebar > *:last-child {
position: sticky;
top: 80px;
}
Thanks for your help!
Can you try this instead?:
.inside-right-sidebar {
height: 100%;
}
.inside-right-sidebar > *:last-child {
position: sticky;
top: 80px;
}
Hi Fernando,
That worked, thank you!
Cheers Jodie
Cheers Jodie! You’re welcome!