[Resolved] Centre Submenu

Home Forums Support [Resolved] Centre Submenu

Home Forums Support Centre Submenu

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #775004
    Ben Foo

    Hi,

    My primary menu is to the right of the screen as I’ve set.
    When i hover over one of the items on that menu to get a sub menu out, I realise that it is not centralized, in the centre of the screen?
    How do i get the sub menu centralized?
    Thank you.

    Best Regards,
    Ben Foo

    #775005
    Ben Foo

    Thanks for your help again.

    #775105
    David
    Staff
    Customer Support

    Hi there,

    so you have added CSS to make the Sub-menu horizontal, but i am not sure what you mean by centralizing it? do you have an image / example of how you want it to look?

    #776377
    Ben Foo

    Yes I have made the submenu horizontal.

    Just that the words in the submenu are not in the center of the screen.
    They are swayed to the left side.
    Is there any CSS or ways to make the words in spread out so that they look center? (as in microsoft word – center, left or right).
    Now I just want words in the submenu to be neat and spread out nicely throughout the width of the page, not skewed to one side like current one.
    Thank you.

    Best Regards,
    Ben

    #776423
    David
    Staff
    Customer Support

    So you have this CSS:

    body .main-navigation ul.menu > li > ul {
        width: 100%;
        left: 0 !important;
    }

    Update it to:

    body .main-navigation ul.menu > li > ul {
        width: 100%;
        left: 0 !important;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    #777819
    Ben Foo

    Thanks.
    It centers the submenu. But some of the words that are at the side of the submenu do not show fully.
    Any solutions for that?
    Thank you.

    Best Regards,
    Ben

    #777846
    David
    Staff
    Customer Support

    i edited the code to include a flex wrap, this will stop the content from escaping the edge on small screens.

    #778435
    Ben Foo

    Thanks so much!

    #778476
    David
    Staff
    Customer Support

    You’re welcome

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