Site logo

[Resolved] Sticky Menu Width Size

Home Forums Support [Resolved] Sticky Menu Width Size

Home Forums Support Sticky Menu Width Size

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #538213
    Kle

    Hi there,

    I have a centered menu and I want the size of the sticky menu to match my menu items and not have a big white space on both sides of the menu. I only see the option to have it contained or full size but not a specific width size or a size to match the size of the width of the menu items.

    Thank you.

    #538247
    Tom
    Lead Developer
    Lead Developer

    Any chance you can link me to your site?

    #538297
    Kle

    I updated the first post with the website address and the username and password are after that divided by a slash /

    #538807
    Tom
    Lead Developer
    Lead Developer

    Played with this a bit – centering fixed items isn’t easy.

    It’s possible, but it will break the “slide down” feature:

    .main-navigation.navigation-stick:not(.gen-sidebar-nav) {
        width: auto !important;
        left: 50%;
        transform: translate(-50%, 0%) !important;
    }
    #538852
    Kle

    Thank you Tom,

    I tried it and it doesn’t fit the menu tight, still white space on both sides. I didn’t thought would be a hard thing to do. And if is not possible I can understand it but in my opinion would be a good thing to add in a future release.

    Which one is the “slide down” feature? I am using the code and don’t see any changes/errors so far.

    Is it possible to apply this code only to the desktop view? how can I change the code to skip the mobile view?

    Thank you.

    #539295
    Tom
    Lead Developer
    Lead Developer

    The non-sticky menu is actually full width, but if we applied CSS to it to make it auto width, it would likely match the current sticky menu.

    I wonder if it would be better to just remove the sticky nav shadow instead of the above CSS? That way it would be very hard to tell the difference between the sticky and non-sticky menu.

    The slide down feature makes it so the menu slides down as it becomes sticky.

    To make something happen on desktop only using CSS, put your CSS in this media query:

    @media (min-width: 769px) {
        /* Your desktop CSS in here */
    }
    #541561
    Kle

    “I wonder if it would be better to just remove the sticky nav shadow instead of the above CSS?”

    Hi Tom, Thank you very much and you are probably right, how can I remove the shadow?

    #542179
    Tom
    Lead Developer
    Lead Developer

    Try this:

    .sticky-enabled .main-navigation.is_stuck {
        box-shadow: 0 0 0 transparent;
    }
    #542192
    Kle

    Hi Tom,

    Thank you but for som reason the code didn’t work on my site. I wonder why?

    #542612
    Tom
    Lead Developer
    Lead Developer
    #542927
    Kle

    Perfect,

    Thank you Tom!

    #543096
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

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