扩展容器div中的div以适应不同的分辨率
我有一个 HTML / CSS 问题,关于在填充其他 div 时如何增长一个 div 以适应屏幕。
这是我的“主”div 内的结构:
我在容器 div 内有 3 个 div,容器内的最后一个 div 具有溢出:auto;属性(因为它具有可滚动内容)。整个容器div向左浮动。
如何让最后一个内部 div 随着屏幕分辨率而扩展?这里的问题似乎是我的容器 div 没有真正的“大小”,所以当我将其设置为 height: 100%;真的没有发生任何事情。当然,这意味着如果我为其分配实际大小,那么它不会增长到分辨率。
我该怎么办?
I've got a HTML / CSS question about growing a div to fit the screen when filled with other divs.
Here's my structure which is inside my "main" div:
I've got 3 divs inside of a container div, with the last div inside the container having an overflow:auto; property (as it has scrollable content). The whole container div is floated left.
How can I get the last interior div to expand with the screen resolution? The problem here seems to be that my container div has no real "size" so when I set it to height: 100%; nothing really happens. Of course this means that if I assign it an actual size, then it won't grow to the resolution..
What should I do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你查过 CSS3 媒体查询吗?这是教程和演示。
Have you looked up CSS3 media queries? Here's a tutorial and demo.