Safari 和 Chrome (webkit) 都以与 firefox 不同的方式呈现绝对定位的元素。
<head></head>
<body>
    <div id="container">
        <div id="one"></div>
        <div id="two"></div>
    </div>
</body>
div#container {
    width: 600px;
}
div#one {
    height: 30%;
    width: 20%;
    background: green;
    margin-left: 13.5%;
    margin-top: 4%;
    position: absolute;
}
div#two {
    height: 30%;
    width: 20%;
    background: blue;
    margin-left: 3%;
    margin-top: 10%;
    position: absolute;
}
恕我直言,问题在于 %-margin-top (根据定义)应该与宽度有关。这在 Firefox 中正确完成,但在基于 webkit 的浏览器中却没有。
有什么帮助吗?