1
我正在用bootstrap創建一個導航欄。它有三個元素:左右兩個圖像和中心的搜索字段。這是我當前的代碼:帶三個元素的導航欄(左,中,右):將左右元素移動到一行,中央元素移動到小?
HTML:
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<form class="navbar-form navbar" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Suche" name="suche">
<div class="input-group-btn">
<button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
<div class="nav navbar-nav navbar-left">
<a href="#"><img src="../images/ITPlattformLogo.png" alt="" height="80"></a>
</div>
<div class="nav navbar-nav navbar-right">
<a href="http://www.hwr-berlin.de/home/" class="navbar-left"><img src="../images/HWRLogo.jpg" alt="" height="80"></a>
</div>
</div>
</nav>
CSS:
.navbar-form
{
position: absolute;
width: 100%;
left: 0;
text-align: center;
padding-top: 14px;
}
對於較小的屏幕尺寸,我想有一個排的兩個圖像和搜索領域的在全屏幕寬度下面的第二行。我怎樣才能做到這一點?