【问题标题】:Floating offset bug with inputs in ie7ie7中输入的浮动偏移错误
【发布时间】:2012-07-19 03:12:59
【问题描述】:

我正在研究一些跨浏览器的表单样式,但在 ie7 中遇到了问题。

如果您在 ie7 中查看我在此处链接的 fiddle,您会看到第一行的输入是偏移的。在其下方类似样式的跨度不会遇到相同的问题。

我正在测试的系统可以在我尝试过的所有其他浏览器上运行。

有没有人能解决这个问题或者更简单的方法来设置它?

【问题讨论】:

  • 我没有看到 IE7 和其他浏览器有什么不同,你能发个截图看看是怎么回事吗?
  • 你是对的......这是我的测试页面上父容器上的 margin-left 导致了这个错误。需要更多调查。

标签: css internet-explorer-7


【解决方案1】:

答案是在所有字段元素周围包裹一个 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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-12
    • 1970-01-01
    • 2011-11-02
    • 2011-03-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多