Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
It’s possible to resize the desktop menu so that it fits another menu item, but it is not possible to resize the desktop menu no matter how many items you add.
OK, how do I resize it so it fits the one item that I need to add?
Also, can it be made responsive so it will always fit one line on a desktop irrelevant of screen resolution?
Actually, some additional CSS to make the main menu use flexbox will allow you to fit all menu items on one line, no matter how many menu items you add.
Add this CSS to the Appearance > Customise > Additional CSS box:
@media only screen and (min-width: 60.001em) {
.main-navigation-menu {
display: flex !important;
float: none;
}
.main-navigation-menu > li {
flex-grow: 2;
display: flex;
flex-direction: column;
}
.main-navigation-menu > li > a {
height: 100%;
padding-right: 0.2em;
padding-left: 0.2em;
text-align: center;
}
.main-navigation-menu > li > ul {
top: 100%;
}
}