100% 高度列
我创建了一个响应式布局,您可以在这里找到:http://pixelcakecreative.com/cimlife/responsive/
左右栏只是网站皮肤的占位符(左右整页广告)。我需要这两列都延伸到页面的最底部。 html
和 body
的高度均为 100%,但由于某种原因,我无法使用 min-height:100%< 让这些列延伸到底部/code>
有什么想法吗?我正在寻找一个纯CSS解决方案,但jquery是一个选择。
I have created a responsive layout which you can find here: http://pixelcakecreative.com/cimlife/responsive/
The left and right columns are simply placeholders for a site skin (left and right full page advertisement). I need both of these columns to extend to the very bottom of the page. Both html
and body
have a height of 100%, but for some reason I cannot get these columns to extend to the bottom with min-height:100%
Any ideas? I am looking for a pure css solution, but jquery is an option.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
jQuery 解决方案是:
我希望这有帮助!
The jQuery solution would be:
I hope this helps!
呃..是的怪癖。我通常使用 $(document).height() 来表示这些东西。正文高度通常仅与内容需要的高度相同,因此 100% 不起作用。
ugg.. yes quirk. i usualy use the $(document).height() for that stuf. the body height is usualy only as hi as the content needs it to be so the 100% does not work.
你必须使用clearfix: http://www.webtoolkit.info/css-clearfix.html 这是纯CSS
You've got to use clearfix: http://www.webtoolkit.info/css-clearfix.html It's pure CSS
您还需要将
height: 100%
添加到所有父 div,而不仅仅是 html 或 body。这应该可以修复您的网站:
You also need to add
height: 100%
to all parent divs, not only html or body.This should fix your website:
这
对我有用。
And
This one work for me.