Re: Targeting Sub-menu Widths
I'm trying to make the sub menus different widths to accommodate the length of the sub-menu names. Some of them are longer than others.
Is there a way to do this with nth:child or something similar?
I've set a width for all of the sub-menus using:
#Top_bar .menu li ul li.menu-item {
width: 250px !important;
}
And I'm targeting the sub-menu underneath 3D Printing with this CSS:
#Top_bar .menu li ul li#menu-item-3223 {
width: 275px !important;
}
Lastly, I'm targeting the sub-menu underneath Events using this CSS:
#Top_bar .menu li ul li#menu-item-3542,
#Top_bar .menu li ul li#menu-item-3532 {
width: 350px !important;
}
Is there a way to do this with nth:child or something similar?
Ref Link: Saratech.com
Comments
.navbar-nav>li>.dropdown-menu
{
width: yourwidth
}
You can add display:
inline-block so that its width will be according to its content automatically
Cheers
Thanks very much for your help!