简体   繁体   English

IE6溢出问题

[英]IE6 Overflow Issue

<div style="float:left; width:50%;">
    div 1
    <div style="position:absolute; width:105%">nested element</div>
</div>
<div style="float:left; width:50%;">
    div 2
</div

If an element exceeds the width of its floated parent element, the next element is pushed down unless I apply overflow:hidden on both floated elements, which defeats the purpose because I DO NOT want to hide the overflowing content. 如果一个元素超出其浮动父元素的宽度,则除非我在两个浮动元素上都应用了overflow:hidden ,否则下一个元素将被向下推,这将达到目的,因为我不想隐藏溢出的内容。 Is there any fix for it? 有没有解决办法?

将其设置为100%,而不是105%-否则,它只是在按照您的指示执行操作。

You have to make sure the content inside is not wider than the divs to stop the elements being pushed down in this scenario. 您必须确保里面的内容不比div宽,以防止在这种情况下将元素下推。

You could perhaps put margin-right: -5% on the positioned div to make it's width narrower in the document flow, but it should still display at 105% wide once rendered. 您也许可以在页margin-right: -5%放置margin-right: -5%放置的div,以使其在文档流中的宽度变窄,但是一旦渲染,它仍应显示105%的宽度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM