2012-07-18 70 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>