2012-07-18 63 views
0

我正在研究一些跨瀏覽器的表單樣式,並且遇到了ie7中的障礙。在ie7中輸入的浮動偏移量錯誤

如果你看看我的鏈接fiddle這裏ie7你會看到第一行的輸入是偏移量。在下面類似的跨度不受同樣的問題。

我正在測試的系統可以在我嘗試過的每個其他瀏覽器上使用。

有沒有人有此修復或確實更簡單的方式來設計它?

+1

我沒有看到VS其他瀏覽器IE7中的任何區別,你可以張貼這是怎麼回事的截圖? – MikeM 2012-07-18 15:26:06

+0

你是對的....這是我的測試頁上導致錯誤的父容器上的頁邊空白。需要更多的調查。 – 2012-07-18 15:41:25

回答

0

答案是圍繞所有字段元素包圍div來撤消hasLayout錯誤。

更多信息可以在這裏找到:http://my.safaribooksonline.com/book/web-development/css/9780321703392/the-usual-suspects/ch04lev1sec3

<form action="#" class="form-horizon"> 
<fieldset> 
    <legend>Test Form</legend> 
    <!-- div fixes hasLayout inherited margin bug in ie7--> 
    <div> 
     <label for="input-focused">Focused</label> 
     <input type="text" id="input-focused" class="focus" value="focused input" /> 
     <label for="input-no-edit">Non editable</label> 
     <span id="input-no-edit" class="no-edit-input">none editable</span> 
    </div> 
</fieldset> 
</form>