[Resolved] Making One Widget In A Sidebar Sticky

Home Forums Support [Resolved] Making One Widget In A Sidebar Sticky

Home Forums Support Making One Widget In A Sidebar Sticky

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2302744
    Jodie

    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

    #2302753
    Fernando
    Customer Support

    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/

    #2302809
    Jodie

    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!

    #2302814
    Fernando
    Customer Support

    Can you try this instead?:

    .inside-right-sidebar {
        height: 100%;
    }
    
    .inside-right-sidebar > *:last-child {
        position: sticky;
        top: 80px;
    }
    #2302819
    Jodie

    Hi Fernando,

    That worked, thank you!

    Cheers Jodie

    #2302829
    Fernando
    Customer Support

    Cheers Jodie! You’re welcome!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.