水平但不垂直地溢出容器div [英] Overflowing a container div horizontally but not vertically
问题描述
我正在使用在容器中使用两列的网站。容器具有白色背景,应伸展到最高的列的底部,因此我使用圣杯方法。
I'm working on a website that uses two columns inside a container. The container has a white background that should stretch to the bottom of whichever column is highest, so I'm using the holy grail method for that.
但是,两个列的位置应使其一部分超出白色背景(此示例使用固定高度,应为流体)。据我所知,这只能通过设置溢出到可见,但打破等高的列。
However, both columns should positioned so that a part of it exceeds the white background (this example uses a fixed height, which should be fluid). As far as I know, this can only be done by setting the overflow to visible but this break the equal height of the columns.
如何解决这个问题?
推荐答案
在这种情况下,最简单的解决方法似乎是添加 < br style =clear:both/> ;
#container
的结束标记之前
The easiest fix in this case seems to be adding <br style="clear:both" />
before the closing tag for #container
.
将其更改为< br class =clearfix/>
和 .clearfix {clear:both}
愿望。
这篇关于水平但不垂直地溢出容器div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!