2012-09-21 193 views
-1

如何對齊2個文本框右側的按鈕,但是垂直居中? (我打算爲Windows 8地鐵的感覺。)HTML垂直居中按鈕對齊

我有什麼:

enter image description here

我想要什麼(樣機):

enter image description here

+0

Windows 8 style =帶純色的按鈕無邊框。 –

+0

爲什麼不直接給它一個保證金? –

+0

這似乎不起作用,因爲它不在它自己的專欄中。 – Flaxbeard

回答

0

可以使用表格標籤如下

<table> 
    <tr> 
     <td> 
     <input type="text" name="textbox1"> 
     <br> 
     <input type="text" name="textbox2"> 
     </td> 
     <td> 
     <button name="abc" value="Submit" type="button">Submit</button> 
     </td> 
    <tr> 
    </table> 

希望它幫助

+1

切勿使用表格來對齊頁面上的元素。表格是表格數據。 –

+0

這是最簡單的方法。我認爲:) –

+0

可能會使用這種方法,但想知道如果這樣使用表是「禁忌」嗎? – Flaxbeard