我希望按鈕和文本排列。我已經使用垂直對齊,但它似乎並沒有工作。 (使按鍵與輸入框中心)如何獲得輸入[type = text]以與Button對齊?
這裏是HTML:
<div class="elegantaeronamefinder">
<div>
<input type="text" id="search_name" name="search_name" />
<input type="submit" class="button" value="GO" id="search_button" name="search_button" />
</div>
</div>
CSS:
.elegantaeronamefinder{
width: 800px;
margin-right: auto;
margin-left: auto;
background:#F2F7FA;/*#DDF0F8;*/
padding: 30px 30px 0px 30px;
min-height: 120px; /*make additional service box bigger*/
font: 12px Arial, Helvetica, sans-serif;
-webkit-box-shadow: 0 0 5px #868686;
box-shadow: 0 0 5px #868686;
color: #666;
border-collapse: collapse;
}
.elegantaeronamefinder input[type="text"], .elegant-aeronamefinder textarea {
color: #888;
width:250px;
padding: 5px 4px 0px 5px;
margin-right: 6px;
margin-left: 5px;
border: 1px solid #CEE2E7;
background: #FBFBFB;
outline: 0;
-webkit-box-shadow: inset 1px 1px 2px rgba(200, 200, 200, 0.2);
box-shadow: inset 1px 1px 2px rgba(200, 200, 200, 0.2);
font: 200 20px/20px Arial, Helvetica, sans-serif;
vertical-align: middle; /*added in to align*/
}
.elegantaeronamefinder .button{
padding: 10px 30px 10px 30px;
background: #44B6F5;
border: none;
color: #FFF;
font-weight:bold;
vertical-align: middle;
margin-bottom: 20px;
margin-top: 5px;
}
這裏是演示: http://jsfiddle.net/5CN67/2/
感謝您提前你的幫助!
嘗試改變下邊距來7px的用於.elegantaeronamefinder .button – Tushar