1

我有一个右浮动、流体宽度的 div,它很好地位于另一个流体宽度、非浮动的列旁边。

一切正常,直到我将另一个流体宽度 div 放入该右浮动列中,此时它扩展为 100% 并将非浮动列放在其下方。我唯一能做的就是给导致问题的 div 一个固定的像素宽度,但我不想这样做,因为它需要扩展到它的父浮点数,但不能超出这个范围。这是问题的一个例子:

    <div style="overflow:hidden;width:800px;">
    <div style="min-width:600px;min-height:200px;float:right;background:#FAA;">
    <div id="floatContent" style="max-width:88%;">Here's some long string of text that makes the width of the parent float expand out to 100% of *its* parent, rather than shrinking the content to its original width (100% minus the width of the non-floated element</div>
  </div>
    <div style="min-width:200px;min-height:200px;background:#CCC;">Some non-floated content</div>
</div>

有任何想法吗?非常感谢。

JSFiddle 链接

4

0 回答 0