我无法在 twitter bootstrap3 中增加导航栏搜索框的大小。我曾尝试将它们作为网格,但即便如此它也不起作用。我不能用百分比来增加搜索框的大小,因为在移动设备上看到时,与其他内容相比,搜索栏看起来太长了。这是我一直在使用的导航栏代码:
<nav class="navbar navbar-default nav-margin-bottom navbar-fixed-top" role="navigation">
<div class="row">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header col-md-1">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<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="#" style="font-weight:500%; font-family:Roboto; margin-left:18px;">Test</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse col-md-10">
<div class="col-md-5">
<form class="navbar-form navbar-left" role="search">
<input type="text" class="form-control home-search" placeholder="Search" >
</form>
</div>
<div class="col-md-7 navbar-right">
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><b>Abcd</b></a></li>
<li><a href="#"><b>Efgh</b></a></li>
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><b>Ijkl</b><b class="caret"></b></a>
<!-- Link or button to toggle dropdown -->
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" tabindex="-1" href="#"><b>Mno</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#"><b>Pqrs</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#"><b>Settings</b></a></li>
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#"><b>Log out</b></a></li>
</ul>
</li>
</ul>
</div>
</div><!-- /.navbar-collapse -->
</div> <!-- /.row -->
</nav>