0

这是一个小提琴:http: //jsfiddle.net/Kd4De/2/

我已经将内容复制了 3 次,如您所见,它似乎into在每次复制时都相互堆叠。我的预期效果是让每个重复看起来都与前一个完全相同(都具有相同的宽度)。

我有一种感觉,因为我只浮动一个div而不是另一个,但这是确保非浮动的流体宽度所必需的div

如何解决此问题以确保每个重复项之间的一致性同时保持流动性(即,如果我动态更改 to 的宽度.dynamo_shop_holder90%则内容会动态更改以适应?我根本不想使用 JavaScript。

谢谢!

4

1 回答 1

0
overflow: hidden;

the overflow attribute tells the browser how to display content that goes beyond the bounds of the container. Some browsers render the content strangely and assume that the parent div has a set height or if empty no height, causing the child or floated divs to appear outside and in your case stack. Overflow hidden is supposed to hide anything that flows outside of the container, but in these cases it allows that parent container to recognize the content that should be within it and display correctly.

I can't see the jsfiddle so not sure what your display looks like, but often overflow: hidden or overflow:auto will allow the divs to correctly handle the contained content.

于 2012-08-28T17:57:09.760 回答