我正在嘗試創建一個聊天窗口,它允許聊天消息(下面的#messages_window)將調整大小以適應聊天區域的標題和輸入區域之間的空白區域。當它調整大小時,它仍然需要滾動。動態高度DIV滾動
下面是HTML我有:
<div id="chat_window">
<div id="header">
</div>
<div id="messages_window">
</div>
<div id="input_area">
<input type="text" id="chat_input"/>
<br/>
<input type="button" style="float:right;" onclick="Javascript:sendMessage();" value="Send"/>
</div>
</div>
這裏是CSS:
#chat_window
{
position: relative;
width: 300px;
height: 100%;
border: 1px solid black;
}
#chat_window #header
{
width: 100%;
height: 30px;
background-color: #69acf1;
color: #ffffff;
border-bottom: 1px solid black;
}
#chat_window #messages_window
{
width: 100%;
/*overflow: hidden;*/
}
#input_area
{
position: absolute;
bottom: 0;
width: 100%;
height: 60px;
}
#input_area #chat_input
{
width: 100%;
}
請閱讀:[應該'嗨','謝謝',標語和致敬從帖子中刪除?](http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and -salutations-be-removed-from-posts) – Antony 2013-05-11 06:08:44
從這麼多的電子郵件發送的SOrry,習慣的力量。謝謝。 – 2013-05-11 06:10:16