私は正面から見たHTML/CSSが新しく、ブートストラップを使用して自分のサイトページを表示して見栄えがよく、応答性が高いです。しかし、私は入力された検索ボックスがあるページを持っていて、それをページの中央に置いて欲しい。これは私のHTMLは次のようになります。垂直方向と水平方向のブートストラップ行を整列するページ
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}
/* for search bar */
.stylish-input-group .input-group-addon {
background: white !important;
}
.stylish-input-group .form-control {
border-right: 0;
box-shadow: 0 0 0;
border-color: #ccc;
}
.stylish-input-group button {
border: 0;
background: transparent;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="col-sm-6 col-sm-offset-3">
<div id="imaginary_container">
<div class="input-group stylish-input-group">
<input type="text" class="form-control" placeholder="search" autofocus>
<span class="input-group-addon">
<button type="submit">
<span class="glyphicon glyphicon-search"></span>
</button>
</span>
</div>
</div>
</div>
</div>
</div>
は、私は何を期待していますと、Googleのホームページに似たページ、上の検索ボックスを中央にあります。どのように私はこれを達成することができます上の任意のアイデア?ありがとう。 Twitterのブートストラップで
コードはすでに動作していますが、なぜ動作していないと思われますか?小さいウィンドウでは、col-md-6とcol-xs-6をdivに追加し、col-md-offset-3とcol-xs-offset-3をそれぞれ追加します。 – Yaser