2010-06-17 91 views
2

我有这个div的高度设置为100%,但内容不断溢出。Css,内容不在边界

这里是页:http://cowgirlsbaking.com/membership

CSS:

#content { 

margin-left: auto; 
margin-right: auto; 
background-color: #FCF6E9; 
width:868px; 
height:100%; 
min-height: 650px; 
-moz-border-radius: 15px; 
-webkit-border-radius: 15px; 
border: 10px solid #EB7CDB; 

回答

4

添加overflow: auto;#content

+0

尼斯,感谢您的帮助。 – Davey 2010-06-17 15:47:21

+0

没问题。 {:) – 2010-06-17 16:03:12

0

这样做的原因是你在内容div中有一个浮动元素,并且你不清除浮动元素。

解决这一问题的最好办法是添加在你的CSS clearfix特定的风格,让你的容器作为指定在这里 http://www.webtoolkit.info/css-clearfix.html

2

这是因为当你漂浮物,他们不占用垂直该clearfix类空间在外部元素。

最简单的办法是content div的结束前补充一点:

<br style="clear:both"> 

或者使用像.clr { clear: both; }一类<br class="clr">