最小高度:100%不会工作,因为我也想要它 [英] min-height:100% won't work as i want it too

查看:143
本文介绍了最小高度:100%不会工作,因为我也想要它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个容器div,其中包含3个div,一个侧边栏,一个内容和一个标题,而其内部的所有元素都应该呈现(如果这可能会影响我的问题,则它们被定位为相对),和内容呈现 min-height:100%按我的需要,包含它们的div不会适应这3个元素,就像 overflow一样:可见的,虽然我不希望内容溢出,但我希望整个页面滚动并使div适应内容大小...



我试着把我的代码放在这里: http://jsfiddle.net/vhZV6/



我也剪掉了一些图形化的tweeks,这些图形tweeks应该完全不会影响......这也是我的问题:



我不需要在这个问题上进行旧的浏览器集成(如IE 5/6) 。

解决方案

尝试将 overflow:auto; 添加到 .container div。


I have a container div, conteining 3 divs, a sidebar, a content and a header while all the elements inside are rendered as they should (they are positioned as "relative" if this may influence in my problem), the sidebar and the content render min-height: 100% as I need, the div containing them won't adapt to those 3 elements, acting like overflow: visible, while I don't want the content to overflow, I want the whole page to scroll and the div to adapt to the content size...

I tried to put my code here : http://jsfiddle.net/vhZV6/

I also cut out some of the graphical tweeks wich should not influence at all... here is a screen of my problem too:

I don't need old broweser integration on this matter (as IE 5/6).

解决方案

Try adding overflow:auto; to your .container div.

这篇关于最小高度:100%不会工作,因为我也想要它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆