如何在不使用overflow:hidden的情况下解决css溢出问题

时间:2015-01-05 21:29:42

标签: jquery html css

基本上body元素底部有大量额外空间。但是当我检查body时,身高是正常数字。那么,如果不在overflow: hidden上设置body,我怎么能摆脱额外的空白?

我不想使用overflow: hidden的原因是它会导致$window.on('scroll')事件中断。有没有办法解决scroll:hidden和jquery窗口之间的冲突?

这里是html和body的css。感谢。

html, 
body, 
.content-wrap {
    overflow-x: hidden;
    width: 100%;
    height: 100%;
    margin: 0;
}

this is the css file relates to this issue i think, the issue is gone without this file

html

抱歉这些杂乱的文件,我不知道在这里提出问题的更好方法

1 个答案:

答案 0 :(得分:0)

尝试使用此...

html{ position:relative; height:100%; }
body{top:0; bottom:0; right:0; left:0;}

这样你的html最小化窗口的高度,并且身体元素被迫填充它......然后只需将页眉,页脚等粘贴在需要去的位置。