繁体   English   中英

过度滚动填满剩余空间?

[英]Over-scroll y filling up remaining space?

我目前正在构建一个固定在页面底部的页脚元素。

  <div id='footer'>
    <div id='chat'> 
      <input class='input-medium' type='text' placeholder="Say something..."/>
      <button class='btn'>Send</button>
    </div>

    <div id='logs'>
       <!-- There will be a lot of logs here and it will be scrollable-y --> 
    </div>
  </div>

我想以这样一种方式构建这个元素,即我的用户可以(垂直地)调整它的大小到他们喜欢的任何高度。 我希望调整大小,以便调整页脚元素的大小将调整#logs 的大小。

我应该如何构建我的 CSS 以便我可以简单地设置页脚的高度,以便:

  • #chat 将首先填满空间。
  • #logs 将填满剩余的任何空间。 如果有溢出,#logs 会溢出吗?

听起来您只是准确描述了您的需求。 不确定您是否需要我们的帮助。 只需将日志设置为 100% 并使用 overflow-y 滚动。

http://jsfiddle.net/LPPAP/1

#footer {
    position: fixed;
    bottom: 0;
    width: 600px;
    border: 1px solid gray;
    background: lightgray;
    border-radius: 15px 15px 0px 0px;
    padding: 10px;
    height: 200px;    
    left: 50%;
    margin-left: -300px;
}
#logs { height: 100%; overflow-y: scroll; margin-top: 20px; }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM