html - 在具有 haslayout 属性的 div 中输入,即具有 "margin-left"

标签 html css internet-explorer

一个简单的html页面。如果你在IE中运行它(我的版本是7)。
你会发现输入有一个“margin-left "(大小为 15px)。
但是如果你删除 (*zoom:1),我们应该使用它来触发 haslayout,即“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 ; 风格完全,它应该工作...

关于html - 在具有 haslayout 属性的 div 中输入,即具有 "margin-left",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10186752/

相关文章:

javascript - 如何正确地将单击的按钮属性值传递给表单提交事件?

javascript - PHP - 使用 JS 动态下拉类值

javascript - CSS 样式操作 : Javascript not Working

javascript - 当脚本是从加载的脚本动态创建的 DOM 节点时,脚本 onload 和 window.onload 的顺序是否定义明确?

html - IE 8 的随机渲染问题

javascript - Internet Explorer 焦点在 addEventListener 触发焦点之前?

javascript - 将动态背景设置为引导模式

html - 当父元素具有固定大小时,overflow auto 在子元素中不起作用

JQuery 可拖动事件在 IE9 中不起作用

html - 针对非 IE 浏览器和特定 IE 版本的有效条件注释