[Resolved] How to Make the last widget on sidebar sticky or scrolls down with the page?

Home Forums Support How to Make the last widget on sidebar sticky or scrolls down with the page?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1442236
    Peter Paul

    Hi GP Team,

    I recently added an ad banner on my side bar.
    Currently there are 5 elements on the side bar.
    The 300×600 ad banner is the last element, and this ad only appears on posts and pages.
    How can I make that ad banner sticky or the last widget sticky, or scrolls down together with the page?
    This way the ad banner remains visible even if the user scrolls down to the bottom of the post/page.
    Kindly let me know.

    Thanks,

    #1442264
    David
    Staff
    Customer Support

    Hi there,

    can you provide a link to your site so i can take a look at what CSS is required.

    #1442295
    Peter Paul

    Link on “private information”
    Note: the sidebar ad will only appear on posts / articles. It’s hidden on front page.
    Thanks!

    #1442310
    David
    Staff
    Customer Support

    try this CSS:

    @media(min-width: 1024px) {
        .site-content {
            display: flex;
        }
    
        .inside-right-sidebar {
            height: 100%;
        }
    
        .inside-right-sidebar .widget:last-of-type {
            position: sticky;
            position: -webkit-sticky;
            top: 60px;
        }
    }
    #1442321
    Peter Paul

    It worked! 🙂
    Thank you very much! (b^_^)b

    #1442347
    David
    Staff
    Customer Support
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.