0

为什么下拉框不会出现在搜索框旁边?

我编辑添加了大部分部分。从正文到导航栏的末尾。我正在使用官方 bootstrap.css

有人有想法吗??

请帮忙!!

截屏

  <body>

  <div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container">
            <a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>

            <a href="/" class="brand">Test</a>



            <div class="nav-collapse collapse navbar-responsive-collapse">
                <ul class="nav">
                    <li><a href="#"><i class="icon-home"></i> Top</a></li>
                    <li><a href="#">Link</a></li>
                    <li><a href="#">Link</a></li>
                    <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <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>



            <form accept-charset="UTF-8" action="/communities" class="navbar-search" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>

            <div class="input-append">
            <input class="span3" id="search" name="search" type="text" />
              <div class="btn-group">
                <button class="btn dropdown-toggle" data-toggle="dropdown">Action <span class="caret"></span></button>
                <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><a href="#">Separated link</a></li>
                </ul>
              </div><!-- /btn-group -->
            </div><!-- /input-append -->

</form>         
            </div>        


            <div class="pull-right">


                <div class="btn-group">
                    <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
                    <i class="icon-user"></i> 
                    Mike                    <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu">
                    <li><a href="/users/edit"><i class="icon-cog"></i> Edit</a></li>
                    <li class="divider"></li>
                    <li>
                    <a href="/logout"><i class="icon-chevron-up"></i> Log out</a>       
                    </li>
                    </ul>
                </div>
            </div>


        </div>
    </div>
</div>  
4

2 回答 2

1

看起来这是BS中的一个错误。将此规则添加到您的 CSS:

.navbar .input-append .btn-group {
  margin-top: 0;
}

你的小提琴更新了。

于 2012-12-16T11:27:41.290 回答
0

试试这个代码,它会解决你的问题

.navbar .btn, .navbar .btn-group {
margin-top: 0px !important;
}
于 2012-12-16T11:14:07.817 回答