Center the menu (yes, simple as that)

Hello guys,

Thank you for your awesome theme but i am stuck with a problem that i am a little ashamed to ask help for. Is there a simple way to completely center the menu in the page?

Atm it’s either floating right or left (i removed the site branding).

I used this css but it doesnt always work properly (on ipad, menu still floating left for exemple)

.site-branding {
    display: none;
}

.col-md-8 {
    width: auto !important;
}

.main-navigation {
    margin-left: auto;
    margin-right: auto;
}

Any help would be appreciated.

Thanks in advance.

Hello Kiwi,

Can you please provide a link to your website?

Kind Regards, Roman.

Hi Roman,

www.nicolasbeuserie.com

It’s almost working, the menu behave like i want at resolution higher than 1024 but if you resize your window, you ll see that menu will float left before switching to togglemenu. And i can’t find a solution to avoid that.

Thanks

Hello Kiwi,

Please try to remove this:

.col-md-8 {
    width: auto !important;
}

.main-navigation {
    margin-left: auto;
    margin-right: auto;
}

…and add this:

#site-navigation {
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
}

Kind Regards, Roman.

You’re the best, simple as that !

Works like a charm… big thanks Roman, keep up your amazing job.

You are welcome Kiwi! And thank you for the kind words :slight_smile:

Kind Regards, Roman.