为什么这个蓝色矩形在 Opera 和 Chrome 中的对齐方式不同?
<div style="float:left; width:465px;">xxx</div>
<div style="width:320px; border:1px solid #099aef; position:absolute; display:inline;">Different position of this rectangle in Opera vs Google Chrome</div>
Opera 在左侧显示蓝色矩形,Chrome 显示不同。为什么? PS 代码被显着简化以发现错误,现在可能没有任何意义。
<div style="float:left; width:465px;">xxx</div>
<div style="width:320px; border:1px solid #099aef; position:absolute; display:inline;">Different position of this rectangle in Opera vs Google Chrome</div>
Opera displays the blue rectangle to the left, Chrome displays it different. Why?
P.S. The code was significantly simplified to find an error and may have no sense now.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在没有位置坐标的情况下,Chrome 似乎会忽略您在第二个 div 上的绝对定位。相反,它将第二个 div 显示在第一个 div 的右侧,就像在正常页面流中一样。
It appears that Chrome is ignoring your absolute positioning on the second div in the absence of position coordinates. Instead, it's displaying the second div to the right of the first as if it was in the normal page flow.