Wednesday, May 14, 2014

Tip: Bootstrap 3.1.1 "dropdown-submenu" Workaround

The new bootstrap navbar does not support more than 2 levels of menu. That is to say the "dropdown-submenu" css class has been removed since Bootstrap 3.0. In order to work around that issue one can add the missing piece into another css file.

Menu HTML Notice how the css class "dropdown-submenu" is used in the HTML snippet.

Menu CSS
Notice how the CSS is put in place. In certain scenario for example when we use a centered navbar, the "!important" command is important to override the Bootstrap original behavior for the third level menu to appear correctly.

No comments: