引导导航栏上的搜索框出现问题-我遇到了引导导航栏上的问题。导航栏上的搜索框出现并放在下面(在标签/移动设备视图上)。

最佳答案

该行必须在navbar-header中,如下所示:



<script src="https://code.jquery.com/jquery-2.2.1.min.js"></script>
<script src="http://getbootstrap.com/dist/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"/>


<nav class="navbar navbar-default">
   <div class="container">
      <div class="navbar-header">
         <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
         <span class="sr-only">Toggle navigation</span>
         <span class="icon-bar"></span>
         <span class="icon-bar"></span>
         <span class="icon-bar"></span>
         </button>
         <div class="row">
            <div class="col-sm-10">
               <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                  <ul class="nav navbar-nav">
                     <li><a href="#">HOME</a></li>
                     <li><a href="#">MEN</a></li>
                     <li><a href="#">WOMEN</a></li>
                     <li><a href="#">KIDS</a></li>
                     <li><a href="#">NEW ARRIVALS</a></li>
                     <li><a href="#">GOODSALE</a></li>
                  </ul>
               </div>
            </div>
            <div class="col-sm-2">
               <form class="navbar-form navbar-right " role="search">
                  <div class="form-group form_search">
                     <input type="text" class=" search_box" placeholder="SEARCH" />
                  </div>
               </form>
            </div>
         </div>
      </div>
   </div>
</nav>

09-25 16:58