イメージをDIV内の背景として設定し、2つの選択ボックスを中央に(縦横に)配置したいとします。私はフォームを水平に中央に置くことができますが、垂直には起こりません。 DIVの一番下にあるフォームセンター。ここでCSSセンターの縦と横の形状
は私のCSSです:ここでは
#box
{
background-image: url(../images/box.gif);
background-repeat:no-repeat;
display: table-cell;
vertical-align: middle;
width:665px;
padding-top:65px;
text-align:center;
}
は私のHTMLです:
<div id="box">
<select id="Select0">
<option selected>Show Selections By</option>
<option value="1">value1</option>
</select>
<select id="Select1">
<option selected>Select State</option>
<option value="1">value1</option>
</select>
<input type="image" onclick="jsfunsrcg()" src="./images/submit.png" alt="Submit Button">
<input type="image" onclick="jsfunsrc="./images/reset.png" alt="Reset">
</div>
私は、Webリソースを見て、そして箱DIVをもたらした利益とその他のオプションをしようとしていますページ全体を移動します。私はすべてを正方形に戻し、コミュニティからのアドバイスを求めると思った。 おかげで、 --Matt
Google検索はやりましたか? http://www.google.com/search?sourceid=navclient&hl=en-GB&q=css+vertical+align and http://blog.themeforest.net/tutorials/vertical-centering-with-css/ – Kumar
ありがとうKumar、私はポストする前にいくつかのグーグルをしましたが、あなたが提供したリンクは参考になりました、ありがとう! –