Archived topic
Center Align Text Mobile Menu
5 replies · Started by Former User on August 11, 2017
Hello,
I am trying to center align the text on the mobile menu which appears after clicking the Hamburger icon, to no avail so far.
I've searched the forums and found this:
/* center align text mobile menu */
@media (max-width: 768px) {
#mobile-header,
#mobile-header ul ul {
text-align: center !important;
}
.menu-item-has-children .dropdown-menu-toggle,
nav ul ul .menu-item-has-children .dropdown-menu-toggle {
float: none !important;
}
}
I also tried it with site-navigation instead of mobile-header. The text continues sticking to the left. (btw, I have navigation search enabled).
Hi there,
Try this:
@media (max-width: 768px) {
.main-navigation .main-nav ul li a {
text-align: center;
}
}
Adding CSS: https://docs.generatepress.com/article/adding-css/
thanks, that did the job!
No problem!
Hi,
I used the above CSS and worked a treat centering the text on the mobile menu, can I get it to centre the icons aswell. https://ceyorks.org
Thanks
Hi there,
This is actually quite complicated because the menu-item-float-right class being used.
Any chance you can open a new support topic?
Thank!