Archived topic
Centered logo with menu (left) and search icon (right)
5 replies · Started by Immi on August 13, 2020
I'm using Navigation as Header, I want to keep the logo in the center menu (left) and search icon (right).
Thanks
Hi there,
It's a bit difficult with the navigation search inside the menu set up we currently have unfortunately.
Give this CSS a shot:
@media (min-width: 769px) {
li.search-item {
position: absolute;
right: 0;
}
.main-navigation:not(.slideout-navigation) .main-nav {
order: 1;
}
.navigation-branding {
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
}
}
Hi,
unfortunately, it's not working
What is not working?
I'm not seeing the code added?
The code you provided below is working fine.
Thank You.
https://docs.generatepress.com/article/centering-logo-mobile-header/#mobile-header .site-logo {
position: absolute;
left: calc( 50% - 90px); /* 50% from the left - half your image width */
}
#mobile-header button.menu-toggle {
position: absolute;
left: 0;
}
Glad to hear :)