Site logo

Archived topic

Sticky container from the sidebar

4 replies · Started by Christian on January 4, 2023

Viewing posts 1–5 of 5

Hello,

I want to make a container of a sidebar sticky. I have found the following code that David provided in another topic but it doesn't work for me. I added make_sticky to the container in the sidebar element and the CSS code in the Customizer > Additional CSS.

@media(min-width: 769px) {
    .inside-right-sidebar {
        height: 100%;
    }
    .make_sticky {
        position: -webkit-sticky;
        position: sticky;
        top: 60px;
    }
}

Best regards
Christian

Hi Christian,

You need to make the parent Container Block full height as well. Try replacing the code you have with this:

@media(min-width: 769px) {
    .inside-right-sidebar, .inside-right-sidebar > .gb-container, .inside-right-sidebar > .gb-container > .gb-inside-container {
        height: 100%;
    }
    
    .make_sticky {
        position: -webkit-sticky;
        position: sticky;
        top: 60px;
    }

}

Hello Fernando,

unfortunately the container is still not sticky with this code.

Sorry, there was a missing . in my code. I updated it now. Can you try the new code above?

Thanks, it's working now!

This archived topic is closed to new replies.