Site logo

[Resolved] Make Top Bar Sticky On Scroll

Home Forums Support [Resolved] Make Top Bar Sticky On Scroll

Home Forums Support Make Top Bar Sticky On Scroll

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1731599
    Michelle

    How can I make my top bar sticky? I like my logo/header/nav the way it is now. I just want the top bar to stay on top and not disappear.

    #1731664
    Ying
    Staff
    Customer Support

    Hi Michelle,

    Try this CSS:

    
    .top-bar.top-bar-align-right {
        position: sticky;
        top: 0;
        z-index: 999;
    }
    nav#sticky-navigation {
        top: 39px !important;
    }

    Let me know ๐Ÿ™‚

    #1731810
    Michelle

    Thank you. That partly worked. There is now a space where the top bar should be, but it is transparent, and not viewable. Maybe some tweaking could fix it. ๐Ÿ™‚

    #1731914
    Ying
    Staff
    Customer Support

    Have you seen the live site without the admin bar activated?

    For example in the customizer.

    Let me know ๐Ÿ™‚

    #1732974
    Michelle

    Hi Ying.

    I turned off Maintenance Mode, refreshed, and checked the top bar. The purple top bar is there, but is translucent instead of opaque. (I can see text beneath it.) Otherwise, the code works. Any suggestions how to keep the top bar fully opaque?

    #1733018
    Ying
    Staff
    Customer Support

    That’s because your top bar background color is set to semitransparent:
    https://www.screencast.com/t/Y3sq3fyX

    You can change it in customizer > colors > top bar.

    #1733125
    Michelle

    Thank you. I will do that.

    #1733131
    Ying
    Staff
    Customer Support

    No problem ๐Ÿ™‚

    #1733185
    Michelle

    Changing the color of the top bar worked for the desktop site, but it covers the sticky logo on mobile. (sigh) Is this fixable, I hope?

    #1733235
    Ying
    Staff
    Customer Support

    Yes ๐Ÿ™‚ try add this CSS:

    nav#mobile-header.is_stuck {
        margin-top: 39px !important;
    }
    #1733252
    Michelle

    YEAH! You have no idea how happy this makes me! Thank you.

    #1733296
    Ying
    Staff
    Customer Support

    Haha I hope you are always this happy ๐Ÿ˜›

    You are welcome!

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