2011-10-05 25 views
0

我在使用Firefox時遇到了CSS的間距問題。這在Chrome中正常工作。當我有一個帶有字段的表單並且在選擇字段之後標記行時,在它前面獲得額外的空間。Firefox中的CSS間距問題選擇字段

您可以在這裏看到圖片中的問題:http://i51.tinypic.com/35b8gmf.png。文本'test2'前面的空間來自哪裏?

下面是代碼:

<style> 
label { 
    float:left; 
    width:70px; 
} 
input, select { 
    width:130px; 
} 
</style> 
<label for="l1">test1</label> 
<select id="l1" name="test1"><option>a</option></select> 
<br> 
<label for="l2">test2</label> 
<input id="l2" type="text" size="30" name="test2"> 
<br> 
<label for="l3">test3</label> 
<input id="l3" type="text" size="30" name="test3"> 
+0

哪個Firefox的版本?什麼是您的平臺Windows或Mac?你打算使用哪種DOCTYPE? –

回答

0
<style> 
label { 
    float:left; 
    width:70px; 
} 
input, select { 
    width:130px; 
} 
</style> 
<label for="l1">test1</label> 
<select id="l1" name="test1"><option>a</option></select> 
<br style="clear:both;"> 
<label for="l2">test2</label> 
<input id="l2" type="text" size="30" name="test2"> 
<br style="clear:both;"> 
<label for="l3">test3</label> 
<input id="l3" type="text" size="30" name="test3"> 
<div id="tests">asd</div>