Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Sticky image in column while scrolling

  • Hi,

    I am so sorry if the subject has already been discussed but I have tried a lot of things I read here an I can’t understand why this is not working for me…

    I just want to make the image in left column of the grid sticky while we scroll so that the long text in right column can be scrolled and still have the image displayed to the left: https://defis-brigade.instawp.xyz/sticky-image/

    I added this CSS, with mystickyelement on the image bloc and sticky-column on the left column (container):

    .mystickyelement {
        position: sticky;
        position: -webkit-sticky;
        top: 50px; /* Offset from top of container */
    }
    
    .sticky-column > .gb-inside-container {
        height: 100%;
    }

    I also tried giving height:100% to the 2 columns. But it doesn’t work.

    Thank you for your help!

  • Hi there,

    try this:

    
    .sticky-column {
        position: sticky;
        top: 50px;
    }
    

    it will make the entire contents sticky.

  • I feel silly. So simple!! Thank you so much David for your help as always.

  • You’re very welcome 🙂

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