2015-09-06 78 views
0

我將如何使按鈕連接到輸入,我不知道如何解決有一個尷尬的差距。如何將按鈕連接到輸入

here is the input and button

#ask { 

     padding: 10px 10px 10px 6px; 
     font-size:45px; 
     background-color:#FAFAFA; 
     min-width: 400px; 
     padding: 0 auto; 
     border-radius: 5px; 

    } 

#button { 
     text-align:center; 

     } 

</style> 


    <input id="ask" type="text" placeholder = "Ex: how tall is the gateway arch" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Ex: how tall is the gateway arch'"/> 
    <input type="image" src="qmb.png" name="saveForm" class="btTxt submit" id="button" height="50.5px" padding = "0px"/> 

回答

0

裹輸入標籤在這樣一個div:

<div> 
    <input....> 
    <input....> 
</div> 

這樣的瀏覽器將調整它們。

您可能還想考慮更改第二個輸入標籤以使用按鈕或提交標籤。

+0

完全相同的結果 –

+0

有空格,你正在使用的圖像? – Tracysss

+0

您也可以使用圖像定位。在CSS中,給它一個位置或「相對」。然後調整頂部或底部屬性。 – Tracysss

相關問題