一个简单的html页面。如果您在IE中运行它(我的版本是7)。您会发现输入具有“左边距”(大小为15px)。
但是如果删除(* zoom:1),我们应该使用它来触发哈希布局,即“ margin-left”消失。

所以这就是为什么???

<!DOCTYPE>
    <html>
    <head>
    <style>
            body,div,input{margin:0;padding:0;}
            .div-inline{display:inline-block;*display:inline;*zoom:1;border:1px solid red;}
            .marginLeft-15{margin-left:15px;}
    </style>
    </head>
    <body>
        <div class="marginLeft-15">
            <div class="div-inline"><input type="text" id="proxy_unuse_address"></div>
        </div>
    </body>
    </html>

最佳答案

我认为display:inline-block;也会触发hasLayout(根据this page),所以为什么不完全删除*display:inline;*zoom:1;样式,它应该可以工作...

09-30 16:07
查看更多