您好我正在尝试在标准引导程序 3 模板中包含搜索栏。我试图以这样一种方式实现它,即当菜单以较小的分辨率折叠时,搜索栏保留在导航栏中,其余的菜单按钮折叠。我让它在桌面分辨率上完美运行,但是当我切换到移动分辨率时,搜索栏会显示在我的标题和导航按钮下方。这是我目前正在使用的 HTML。
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">My Project</a>
</div>
<div class="col-sm-3 col-md-3 navbar-right">
<form class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="srch-term" id="srch-term">
<div class="input-group-btn">
<button class="btn btn-default" type="submit"><span class="glyphicon glyphicon-search"></span></button>
</div>
</div>
</form>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">Browse Courses</a></li>
<li><a href="#contact">Active Courses</a></li>
<li><a href="#contact">Shopping Cart</a></li>
<li><a href="#contact">Recently Viewed</a></li>
</ul>
</div><!--/.navbar-collapse -->
</div>
</div>
如何确保菜单折叠时搜索栏不会消失或显示为第二行?非常感谢