html - css 中间 div 滚动和 100% 高度

标签 html height css

我确定之前有人问过这个问题,但我找不到。

请参阅http://jsfiddle.net/Bw5j4/1/

我想让 #room div 适合 #top#commands 之间的 100%,即使其中没​​有内容。

而且,如果内容重叠(如当前示例中所示),我想将其放入带有滚动条的 #room 的边界内。

我需要将 #commands 固定在页面底部。我试过 height 和 max-height 但没用。

最佳答案

这应该让你开始锁定中间部分

.room {
  background-color:#fff;
  border:1px solid #d8d8d8;
  overflow:auto;
  position:fixed;
  top:80px;
  bottom:150px;
  left:0;
  right:0;
}

关于html - css 中间 div 滚动和 100% 高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6415019/

相关文章:

JavaScript AddEventListener 异常

html - Flex wrap layout with boxes that "float left"- 使最后一行框与其余框宽度相同

jquery - DIV高度取里面img的高度,而不是用CSS设置的高度

delphi - Firemonkey T编辑高度

html - 设置div的高度以适应剩余空间的方法

html - 如何将新图标添加到 HTML 元素的 CSS 类

jQuery Mobile 1.3.0 - 对话框窗口不会在通过 AJAX 加载页面时打开

javascript - 如何选择 div 的每个 child 并获得第 n 个数字

html - 为什么浏览器为重音字符保留空间,即使没有重音字符?

css - 使用 Bootstrap 的全屏背景照片