我想要我的网页中有两个水平区域。第一个是菜单。它在顶部。不幸的是,我不知道它的大小,它可能会随着用户操作而改变。菜单下方是主要区域,应至少延伸到窗口底部(如果内容很少)或超出(如果内容很多)。
用 ASCII 艺术来说明:
+----------------------------------------------------+
| This area resizes vertically depending on contents |
+----------------------------------------------------+
| This area stretches to the bottom of the window, |
| but can be even larger if necessary. Note: this |
| should be a separate area because it will contain |
| children with height:100% as well. |
| |
+----------------------------------------------------+
这可以做到吗?可以用Javascript完成吗?
补充:为了正确看待事物并避免混淆,可以这样想:顶部菜单是我自己生成的,但底部区域是一个 IFrame,我想填充页面的其余部分。在我的情况下,这就是它最终归结为的原因。