制作浮动div填充容器?
Trying to get a floating div to fill the height of its parent, but the #sidebar
doesn't seem to want to expand past auto
.
Example here: http://jsfiddle.net/FDQKm/
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
身高:100% 从来没有对我有用过。我一直所做的就是通过将“overflow:hidden”应用于父div(在您的情况下是main),然后添加“padding-bottom:5000px;”,使div看起来为全高。边距底部:-5000px;”我试图让 div 看起来全高。这将扩展恰好存在的任何背景和侧边框,就好像该元素实际上是父 div 的完整高度一样。
Height:100% has never worked for me. What I've always done is made divs appear to be full height by applying "overflow:hidden" to the parent div (main in your case), and then adding a "padding-bottom:5000px;margin-bottom:-5000px;" to the div I'm trying to make look full height. This will extend any backgrounds and side borders that happen to be there, as if the element was actually the full height of the parent div.
使父 div 位置=相对,然后调整内部 div 的大小。
内部 div 的高度应为:height:100%
make the parent div position= relative and then resize your inner div.
height of the inner div should be : height:100%