我一直在使用以下 HAML 代码生成 Bootstrap 2.xy 导航栏:
.navbar.navbar-fixed-top.navbar-inverse
.navbar-inner
.container
%a.brand{:href => '/'} xyz.com
%ul.nav
%li
%a{:href => '/'}Home
%li
%a{:href => '/blog'}Articles
%li
%a{:href => '/research'}Research
%li
%a{:href => '/contact'}Contact
%li
%a{:href => '/gallery',}Gallery
在狭窄的浏览器窗口或手机上查看时,导航栏元素堆叠得很好,如屏幕截图所示:
我刚刚尝试将我的项目升级到 Bootstrap 3。我现在将这个 HAML 代码用于导航栏:
.navbar.navbar-fixed-top.navbar-inverse
.container
%a.navbar-brand{:href => '/'} xyz.com
%ul.nav.navbar-nav
%li
%a{:href => '/'}Home
%li
%a{:href => '/blog'}Articles
%li
%a{:href => '/research'}Research
%li
%a{:href => '/contact'}Contact
%li
%a{:href => '/gallery',}Gallery
但是,导航栏现在不像以前那样工作(见第二个屏幕截图):
如何使用 bootstrap 3 RC1 修复 HAML 代码以恢复旧行为?