我正在使用引导程序并尝试将搜索表单放在导航栏下拉菜单中,但我发现表单看起来被压扁了,因为下拉菜单的宽度太小了。此外,表单元素不是我想要的。我该如何解决?
一般来说,我是 CSS 和网页设计的新手。请帮忙!
当前布局:
我想要达到的目标:
<header class="navbar navbar-inverse navbar-fixed-top navbar-inverse" role="banner">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-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 href="index.html" class="navbar-brand">Brand</a>
</div>
<nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
<ul class="nav navbar-nav">
<li class="active"><a href="index.html">Home</a></li>
<li><a href="#">Browse</a></li>
</ul>
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Locate <b class="caret"></b></a>
<ul class="dropdown-menu">
<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<button type="button" class="btn btn-default navbar-btn"><li class="icon-screenshot"></li></button>
<input type="text" class="form-control" placeholder="Address">
</div>
<div class="btn-group">
<button type="submit" class="btn btn-default">Search</button>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
</div>
</form>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">USER <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#"><i class="icon-pencil"></i> Link</a></li>
<li><a href="#"><i class="icon-upload"></i> Link</a></li>
<li class="divider"></li>
<li><a href="#"><i class="icon-signout"></i> Link</a></li>
</ul>
</li>
</ul>
</nav>
</div>
</header>