body, html{
min-height: 100%;
height: 100%;
}
#wrapper_with_fancy_bg_that_blends_into_bodys_bg{
height: 100%;
min-height: 100%;
}
这很尴尬,但我不知道如何在放大然后向下滚动时得到这个:
_
我想出的唯一解决方案是在调整窗口大小时将 div 的高度设置为 body 的高度。有没有办法让 div 实际上跨越 100% 的 body 高度,无论使用普通 css 是什么?
最佳答案
这应该可以解决问题:
html, body {
margin: 0;
padding: 0;
height: 100%;
}
#wrapper_with_fancy_bg_that_blends_into_bodys_bg {
min-height: 100%;
height:auto !important;
height:100%;
overflow: hidden !important;
/* your fancy background here */
}
这是一个有效的 JsFiddle:http://jsfiddle.net/hehUH/1/或完整 View http://jsfiddle.net/hehUH/1/show/
关于html - Div 跨越浏览器的 100% 高度并缩放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13931478/