Site logo

[Resolved] How To Make Container Sticky in Sidebar?

Home Forums Support [Resolved] How To Make Container Sticky in Sidebar?

Home Forums Support How To Make Container Sticky in Sidebar?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2495014
    Jeffrey

    Hey,

    In my sidebar, I have sticky Table of Content (“Easy Table of Contents” plugin has option to make it sticky, so it works well).
    Now I want to add new container after “Table of Contents” which will be also sticky.
    Please help.

    #2495148
    David
    Staff
    Customer Support

    Hi there,

    can you share a link to a page on your site where i can see the ToC?

    #2495216
    Jeffrey

    Here is staging

    #2495535
    David
    Staff
    Customer Support

    With CSS unless the exact height is known for each “widget” you can’t sticky just the first two.
    You would have to make the whole sidebar sticky, so remove your current sticky CSS and add this instead:

    @media (min-width: 768px) {
        #right-sidebar .inside-right-sidebar {
            position: sticky;
            top: 20px;
        }
    }
    #2497816
    Jeffrey

    Thank you David.

    Where should I indicate that CSS?
    Do you mean style.css or somewhere else?

    #2497887
    Ying
    Staff
    Customer Support

    Hi Jeffrey,

    You can use one of the methods introduced here:
    Adding CSS: https://docs.generatepress.com/article/adding-css/

    #2497924
    Jeffrey

    Thank you!

    #2497961
    Ying
    Staff
    Customer Support

    No Problem 🙂

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