Archived topic
Sub-navigation/menu styling
5 replies · Started by Oskar on November 25, 2021
I've added a separator line between my submenu items but don't need this line to show for the last submenu item. I tried with last child display none but this didn't work. Also the submenu is overlapping with the main nav a little bit. It disappears tho when you scroll a little. I'd appreciate a little help with this.
Hi Oskar,
On your site's custom CSS, you have this:
.main-navigation .main-nav ul ul li a {
text-transform: none;
font-size: 12px;
font-weight: 500;
letter-spacing: 2px;
text-align: left;
border-bottom: 1px solid;
border-color: #83918b;
padding-top: 15px;
padding-bottom: 15px;
}
Replace it with this:
.main-navigation .main-nav ul ul li a{
text-transform: none;
font-size: 12px;
font-weight: 500;
letter-spacing: 2px;
text-align: left;
padding-top: 15px;
padding-bottom: 15px;
}
.main-navigation .main-nav ul ul li:not(:last-child) a{
border-bottom: 1px solid;
border-color: #83918b;
}
As for the submenu overlap, try playing around with the menu item's height on Appearance > Customize > Layout > Primary Navigation
Thank you, that's amazing! It worked for desktop, how do I get the same for the mobile menu?
Try modifying the selector not(:last-child) to not(:last-child,:only-child) so it applies only to submenus with multiple items. :D
Thank you! That worked.
No problem. Glad to be of any help. :D