2012-03-12 113 views
0

我想在搜索框和搜索按鈕之間的所有瀏覽器(除了Internet Explorer)之間構建搜索頁面和對齊方式是正確的。所使用的CSS代碼是搜索框和搜索按鈕之間的對齊問題

#srchBox {height:25px;width:400px;margin-top:15px;margin-bottom:5px;} 

#srchBtn{height:32px; width:100px; vertical-align:middle;} 

其所有的權利在Firefox和Chrome ..

http://yfrog.com/e9ncn8j

+0

請把你的代碼,以便更好地理解 – sandeep 2012-03-12 12:06:22

+0

THR是nthing更多... JST和輸入類型的文本和按鈕.. – Sam 2012-03-12 12:29:45

回答

0

看到:

在IE9,FF8和Chrome

測試
<!DOCTYPE html> 
<html> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
</head> 
<body> 
    <div style="background-color:#DDDDDD"> 
     <input type="text"><input type="button" value="search"> 
    </div> 
</body> 
</html> 
+0

完美對齊;) – Ace 2012-03-12 13:20:30

+0

如果你想設置文本框的WIDTH,只需使用size =「30」 gr – Ace 2012-03-12 13:21:37

+2

謝謝.... Thans很多.. – Sam 2012-03-12 16:55:33

0

u盤垂直對齊4 srchBtn的所有CHILDS。 嘗試將srchBox & srchBtn放入div中,併爲div元素指定垂直對齊。

希望這是個問題

otherwhise嘗試垂直對齊:基線

+0

ITs不wking ... – Sam 2012-03-12 12:29:22

0

嘗試浮動:留在這兩個元素。您可能需要邊距設置爲0。