[Support request] Main Content Scroll Over Hero

Home Forums Support [Support request] Main Content Scroll Over Hero

Home Forums Support Main Content Scroll Over Hero

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2076465
    Damon

    Hello.
    (Please delete if not allowed).

    Has anyone customised GP so that the main content scrolls over the top of the hero image? Like in this example https://wordpress.org/themes/sixteen/
    If so could you tell me how please?

    Kind regards

    #2076507
    David
    Staff
    Customer Support

    Hi there,

    its possible with some CSS to give the hero a fixed position.

    Do you have a site with a page hero and some content so i can look at the requirements ?

    #2076515
    Damon

    Hi David.
    Sure thing. I’ve sent you a login in the private info.
    Cheers
    Damon

    #2076684
    David
    Staff
    Customer Support

    Hmmm… tricky one – for that the hero needs to be fixed at the top of the page, so the site header can’t really sit before it. If the header was merged then it may be possible:

    https://docs.generatepress.com/article/merging-header-navigation-content/

    #2077045
    Damon

    Cool. Thanks David.
    I’ll give that a go.
    All th best

    #2077687
    David
    Staff
    Customer Support

    Let us know how you get on!

    #2078021
    Damon

    Hi David,
    I’ve merged the header but am unsure how to get the main container to scroll over it… I’ve tried using CSS “position” to no avail.
    Any tips from anyone gratefully received.

    #2078125
    David
    Staff
    Customer Support

    Can you share a link to your site?

    NOTE: When a topic is resolved we automatically remove any private information.

    #2080425
    Damon

    Hi David
    See private info.
    Thank you
    Damon

    #2080442
    David
    Staff
    Customer Support

    Kinda close with this CSS:

    @media(min-width: 1140px) {
        .page-hero {
            position: -webkit-sticky;
            position: sticky;
            top: 0;
        }
        .page-hero + #page {
            position: relative;
        }
    }

    I only applies to wider screens you can adjust the 1140px to suit.
    But the Title as part of the Page Hero so that won’t scroll up….

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