下拉与固定宽度的Navbar(Dropdown in navbar with fixed width

2019-10-17 09:04发布

我建立导航栏与固定宽度bootstap,下面是我使用的代码,但在右侧的下拉菜单无法正常工作

 <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container">
                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <a class="brand" href="/">PROJECT</a>
                <div class="nav-collapse">
                    <ul id="menu" class="nav">
                        <li><a href="#">Home</a></li>
                        <li><a href="#">About</a></li>
                        <li><a href="#">Contanct</a></li>
                    </ul>
                </div><!-- /.nav-collapse -->
                <ul class="nav pull-right"> <!-- user-menu dropdown --> 
                    <li class="dropdown" id="user-menu">
                        <a href="#user-menu" class="dropdown-toggle" data-toggle="dropdown">
                            <i style="opacity: 0.40;" class="icon-user icon-white">&nbsp;</i>&nbsp;Anonymous
                            <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu">
                            <li data-name="user-activity"><a href="#">Preferences</a></li>
                            <li class="divider"></li>
                            <li><a href="#">Logout</a></li>
                        </ul>
                    </li>
                </ul> <!-- /user-menu dropdown --> 
            </div>
        </div><!-- /navbar-inner -->
    </div>

我已经包含下面的CSS和顺序的方式JS:

  • bootstrap.min.css
  • 自举responsive.min.css
  • jQuery的1.4.1.js
  • bootstrap.min.js
  • 引导-dropdown.js

Answer 1:

除去<div class="container">和它的工作。

http://jsfiddle.net/XXwnH/



文章来源: Dropdown in navbar with fixed width