0

您好,我只是想知道如何实现一个带有固定标题和回复文本框的聊天框。到目前为止,这就是我所拥有的。

.headerchat{
background-color: #336699;
width: 100%;
padding-top: 3px;
padding-bottom: 3px;
font-weight: bold;
color: #fff;
display: block;
}
.buddies {
    background-color: #fff;
    border: 1px solid #ccc;
    bottom: 30px;
    display: none;
    font-size: 12px;
    left: 205px;
    position: fixed;
    width: 235px;
    height: 200px;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
}
.messages {
    background-color: #fff;
    border: 1px solid #ccc;
    bottom: 30px ;
    font-size: 12px;
    display: none;
    left: 205px;
    position: fixed;
    width: 235px;
    height: 400px;
    margin: 0;
    padding: 0;
    overflow: scroll;
    z-index: 100;   
}
.gray{
    color:#aaa;
}
.chat{
    word-wrap:break-word;
    width: 235px;
}
.username{
    text-decoration: none;
    color: #336699;
    text-transform: capitalize;
}
.username:hover{
    text-decoration: none;
    color: #6699aa;
}
.conversation{
    width:235px;
    padding: 0;
    border-bottom: 1px dotted #999;
    float: left;
}
/*.conversationpicture{
    float:left;
}*/
.closecontainer{
    float: right;
}
.close, .close:hover{
    text-decoration: none;
    font-weight: bolder;
    color: #fff;
}
.buddycontainer
{
    float:left;
}
.formchattext
{
    display: block;
    font-size:12px;
    border:1px solid #ccc;
    width:234px;
    padding: 0;
    margin: 0;
    height: 30px;
    position: fixed;
    bottom: 30px;
}

http://jsfiddle.net/ENydt/

我想要实现的是有一个固定的标题、可滚动的内容和固定的回复文本字段。

我试过溢出-x:滚动;对于 .buddies 和 .messages 仍然没有运气,我还是新手,所以我真的很抱歉。如果您可以快速浏览一下。谢谢。

4

1 回答 1

1

我修改了你的代码,这是

示例代码:

.antiscroll-inner {
    height: 300px;
    overflow-y:scroll;
}

演示:

http://jsfiddle.net/ENydt/13/

在未来的编码中尽量避免为 html 元素编写内联样式

于 2013-05-21T13:35:43.557 回答