Site logo

[Resolved] Make one sidebar block sticky (TOC) but other blocks to be non-sticky

Home Forums Support [Resolved] Make one sidebar block sticky (TOC) but other blocks to be non-sticky

Home Forums Support Make one sidebar block sticky (TOC) but other blocks to be non-sticky

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2574660
    George

    Hello,

    So here’s how my site’s pages currently look with a right sidebar template: https://giveawaylisting.com/monthly-giveaway/

    As you see on the sidebar, there are in this order: a) vertical Google Ads(removed temporarily and replaced with an image), a TOC (SimpleTOC) and an image.

    I’m wondering how I can make only the TOC remain sticky, yet everything else to be non-sticky. Can you please help me? Thanks!

    #2574664
    Ying
    Staff
    Customer Support

    Hi George,

    Try the below CSS:

    @media(min-width:769px) {
    .inside-right-sidebar {
        height: 100%;
    }
    
    .inside-right-sidebar #block-12 {
        position: sticky;
        top: 100px;
    }
    }

    Adding CSS: https://docs.generatepress.com/article/adding-css/

    #2574679
    George

    Works like a charm, thanks!!!

    #2575858
    Ying
    Staff
    Customer Support

    No problem 🙂

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