我想填充导航栏中间部分的文本框,如图所示。
有人可以告诉我该怎么做吗?
我查看了Bootstrap 3 - How to maximize input width inside navbar但是当调整窗口大小时,该输入字段不会自动调整大小。
实际上这不是他的要求,我刚发布以表明我尝试了这种方法。我也需要自动调整大小。
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-content">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Brand</a>
</div>
<div class="collapse navbar-collapse" id="navbar-content">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Shells <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">None</a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Jobs <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">None</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">History <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">None</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Menu <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#console">Help</a></li>
<li class="divider"></li>
<li class="dropdown-header">Account</li>
<li><a href="#console">Edit Profile</a></li>
<li id="logout"><a href="#console">Logout</a></li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
</form>
</div>
</div>
</nav>