Bootstrap 3 is still at RC, but I was just trying to implement it. I couldn't figure out how to put a sub menu class. Even there is no class in css and even the new docs don't say anything about it
It was there in 2.x with class name as dropdown-submenu
I make another solution for dropdown. Hope this is helpfull Just add this js script
@skelly solution is good but will not work on mobile devices as the hover state won't work.
I have added a little bit of JS to get the BS 2.3.2 behavior back.
PS: it will work with the CSS you get there: http://bootply.com/71520 though you can comment the following part:
CSS:
JS:
The result can be found on my WordPress theme (Top of the page): http://shprinkone.julienrenaux.fr/
Until today (9 jan 2014) the Bootstrap 3 still not support sub menu dropdown.
I searched Google about responsive navigation menu and found this is the best i though.
It is Smart menus http://www.smartmenus.org/
I hope this is the way out for anyone who want navigation menu with multilevel sub menu.
update 2015-02-17 Smart menus are now fully support Bootstrap element style for submenu. For more information please look at Smart menus website.
Shprink's code helped me the most, but to avoid the dropdown to go off-screen i updated it to:
JS:
CSS: FROM background-color: #eeeeee TO background-color: #c5c5c5 - white font & light background wasn't looking good.
I hope this helps people as much as it did for me!
But i hope Bootstrap add the subs feature back ASAP.
Updated 2018
The
dropdown-submenu
has been removed in Bootstrap 3 RC. In the words of Bootstrap author Mark Otto..But, with a little extra CSS you can get the same functionality.
Bootstrap 4 (navbar submenu on hover)
Navbar submenu dropdown hover
Navbar submenu dropdown hover (right aligned)
Navbar submenu dropdown click (right aligned)
Navbar dropdown hover (no submenu)
Bootstrap 3
Here is an example that uses 3.0 RC 1: http://bootply.com/71520Here is an example that uses Bootstrap 3.0.0 (final): http://bootply.com/86684
CSS
Sample Markup
P.S. - Example in navbar that adjusts left position: http://bootply.com/92442
Comment to Skelly's really helpful workaround: in Bootstrap-sass 3.3.6, utilities.scss, line 19:
.pull-left
hasfloat:left !important
. Since that, I recommend to use !important in his CSS as well: