[英]Over-scroll y filling up remaining space?
I am currently building a footer element that fixed at the bottom of the page.我目前正在构建一个固定在页面底部的页脚元素。
<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>
I want to structure this element in such a way that my users can resize (vertically) this to however tall they like.我想以这样一种方式构建这个元素,即我的用户可以(垂直地)调整它的大小到他们喜欢的任何高度。 I would the resizing to be done such that resizing the footer element will resize #logs.我希望调整大小,以便调整页脚元素的大小将调整#logs 的大小。
How should I structure my CSS such that I can simply set a height for the footer so that:我应该如何构建我的 CSS 以便我可以简单地设置页脚的高度,以便:
It sounds like you just described exactly what you need.听起来您只是准确描述了您的需求。 Not sure you needed our help.不确定您是否需要我们的帮助。 Just set the logs to 100% and overflow-y to scroll.只需将日志设置为 100% 并使用 overflow-y 滚动。
http://jsfiddle.net/LPPAP/1 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.