100% 高度 div 内的两个垂直 div
抱歉我的英语不好,希望你能理解我的问题。
我正在思考一个我知道我以前已经解决过一次的问题。问题是我需要在一个 div 内有两个 DIV,其中一个 DIV 具有给定的高度,另一个 DIV 填充父 div 高度的其余部分。问题是第二个 div(没有定义高度,或 100% 高度)需要通过垂直滚动条实现溢出。所有这些都是为了创建一个类似于窗口设置的“外观”,您可以在其中操作左侧的列表和右侧的操作窗口。左侧列表需要一个标题,您可以在其中限制列表和搜索。
看看 http://kokongcrm0.server111.wdc.webdeal.no/index -test.php 查找问题的示例。
所有帮助都是很好的帮助(!)提前感谢。如果有人可以提供帮助,我会很高兴!
Sorry for my bad english, hope you will understand my issue.
I'm turning my head around a problem that I know I've been solving once before. The issue is that I need two DIVs inside a div where one of the DIVs has a given height and the other one fills up the rest of the parent div height. The problem is that the second div (with no defined height, or 100% height) needs to be overflow-able with an vertical Scroller. All this is to make an "outlook" lookalike windowsetup where you operate a list on the left and an actionwindow on the right. The left list needs a header where you can limit the list as well as search.
Have a look at http://kokongcrm0.server111.wdc.webdeal.no/index-test.php to find an example of the issue.
All help is good help (!) Thanx in advance. I would be so glad if someone could help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用
position:relative
与position: 结合使用绝对的
。现场演示
去掉最后两行:
替换他们:
Use
position: relative
combined withposition: absolute
.Live Demo
Get rid of these last two lines:
Replace them with:
这是一种稍微不同的方法,因此您不需要同时使用顶部和底部坐标 - 这样它也可以在 IE7 中工作
(这确实涉及将 IE6/7 置于 Quirks 模式,但是如果有任何用途,请参阅 Doctype 之前的注释,具体操作方法)
JSBIN - IE7 兼容版本
非常相似,因为它使用相对和绝对的混合,但此方法使用边框框大小调整模型,因此可以通过填充创建空间并仍然保持高度的使用:100% ;
here's a slightly different way to do it so you don't need to use the top and bottom co-ordinates together - that way it can be made to work in IE7 too
(this does involve putting IE6/7 into Quirks mode though, but if it's any use see the comment before the Doctype how to do that)
JSBIN - IE7 compatible version
This is the quite similar to thirtydots, in that it uses a mixture of relative and absolute, but this method uses the border-box box-sizing model so space can be created by padding and still maintain the use of height: 100%;
删除那个 1k Height div,并使这个 iWrapper 版本自动流动。因此,将其更改
为:
或将其添加到样式表中。
Delete that 1k Height div, and make this iWrapper ver flow auto. So change this:
to this:
Or add it to your stylesheet.