0

我正在尝试在下拉菜单中包含一个图标。该图标导致菜单呈现不正确(似乎图标在菜单栏和菜单上重复出现)。片段:

<div class="navbar navbar-inverse navbar-fixed-top">
  <div class="navbar-inner">

    <button type="button" 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>
    </button>

    <a class="brand" href="#">Project X</a>

    <div class="nav-collapse">
      <ul class="nav">
        <li class="active"><a href="#">Home</a></li>

        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">
            Menu 1
            <b class="caret"></b>
          </a>
          <ul class="dropdown-menu">
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
            <li class="divider"></li>
            <li class="nav-header">Nav header</li>
            <li><a href="#">Separated link</a></li>
            <li><a href="#">One more separated link</a></li>
          </ul>
        </li>
      </ul>

      <ul class="nav pull-right">
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">
            Menu 2
            <b class="caret"></b>
          </a>
          <ul class="dropdown-menu">
            <li><i class="icon-off"><a href="#">Logout</a></li>
          </ul>
        </li>
      </ul>
    </div>

  </div>
</div>

知道是什么原因造成的吗?

4

2 回答 2

5

您需要关闭标签。

<i class="icon-off"></i>
于 2012-11-14T18:37:01.917 回答
1

这对我有用

<li> <a href="#"> <i class="icon-off"> </i>  Sign Out </a> </li>
于 2013-05-19T13:50:31.167 回答