引导下拉菜单表现得很奇怪

时间:2013-06-01 08:56:01

标签: javascript html css twitter-bootstrap

我有这段代码:

<div class="navbar">
      <div class="navbar-inner">
        <div class="container" style="width: auto;">
          <ul class="nav">
            <li><a href="/./">Startseite</a></li>
            <li class="dropdown">
                  <a id="drop1" href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">Produkte<b class="caret"> </b></a>
                  <ul class="dropdown-menu" role="menu" aria-labelledby="drop1">
                    <li role="presentation"><a role="menuitem" tabindex="-1" href="http://google.com">Action</a></li>
                    <li role="presentation"><a role="menuitem" tabindex="-1" href="#anotherAction">Another action</a></li>
                  </ul>
            </li>
            <li class="dropdown">
                  <a id="drop2" href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">Produkte<b class="caret"> </b></a>
                  <ul class="dropdown-menu" role="menu" aria-labelledby="drop2">
                    <li role="presentation"><a role="menuitem" tabindex="-1" href="http://google.com">Action</a></li>
                    <li role="presentation"><a role="menuitem" tabindex="-1" href="#anotherAction">Another action</a></li>
                  </ul>
            </li>
          </ul>
        </div>
      </div>
    </div>
它应该像这样出现:

enter image description here

但它在我的代码中显示如下(我点击produkte):

enter image description here

这是我在html中的标题:

<link href="{{STATIC_URL}}css/bootstrap.css" rel="stylesheet">
<script src="{{STATIC_URL}}js/jquery191.js"></script>
<script src="{{STATIC_URL}}js/bootstrap.min.js"></script>
这是为什么?有人可以帮帮我吗?

非常感谢

1 个答案:

答案 0 :(得分:2)

您已将float:left用于li,需要将其从custom css文件中删除。