[Resolved] How To make a sticky sidebar?

Home Forums Support [Resolved] How To make a sticky sidebar?

Home Forums Support How To make a sticky sidebar?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1992480
    NeedForGaming

    I want to make a sticky sidebar both for home and single post. I used the below CSS code it didn’t work for me.


    @media
    (min-width: 769px) {
    .inside-left-sidebar {
    position: sticky;
    top: 100px;
    }
    }

    #1992962
    Ying
    Staff
    Customer Support

    Hi there,

    Any chance you can link us to the site in question?

    You can use the private information field.
    https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information

    Let me know 🙂

    #1992966
    NeedForGaming

    This is not my answer, please tell me how to do that.

    #1993010
    Ying
    Staff
    Customer Support

    If that CSS doesn’t work, I have to see the live site code to adjust the CSS.

    I can’t write CSS with imagination unfortunately.

    You can put your site link in to the area where the red arrow is pointing to:
    https://www.screencast.com/t/ns5qMczbx

    #1993371
    NeedForGaming

    Ok

    #1993372
    NeedForGaming

    Alright!

    #1993397
    Ying
    Staff
    Customer Support

    1. the sidebar on your home page is right sidebar, not left sidebar, so the CSS would be:

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

    2. You have this CSS, if the right sidebar’s ancestor element has overflowset to hidden, stickyCSS won’t work. You’ll need to remove this CSS:

    html, body {
        overflow-x: hidden;
    }

    Let me know if you need further assistance 🙂

    #1993413
    NeedForGaming

    Thanks, it works.

    #1994119
    Ying
    Staff
    Customer Support

    You are welcome 🙂

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