我创建了脸书喜欢聊天的boxes.In朋友列表,因为我选择了一个聊天框是open.But我正在使用下面的聊天框。
.chat_box{
position:fixed;
bottom:0px;
right:20px;
width:250px;
background-color:white;
border-radius:5px 5px 0px 0px;
}
我使用的是right:20px;但是如果我打开多个聊天框,那么我将不得不在计算后一次又一次地设置这个right属性。如何在没有硬编码位置的情况下打开多个聊天框?
发布于 2015-03-07 23:51:32
这个问题还不清楚。代码段未为我加载。我希望它能对你有所帮助。
.chat_box
{
width: 250px;
position: fixed;
height: 100%;
right: 20px;
top: 0px;
padding-top: 10px;
padding-bottom: 10px;
border: 1px solid white;
}发布于 2015-03-07 23:53:03
在容器上设置position:fixed,然后使用float:left将盒子放入容器中
Plunkr here
发布于 2015-03-08 00:07:20
对于多个修复的代码,请尝试此方法。
<div class='chatbox-group'>
<div class='chat_box'>
</div>
<div class='chat_box'>
</div>
</div>
Css for this
.chatbox-group
{
position:fixed;
bottom:0px;
width:100%;
}
.chat_box{
float:right;
margin-right:20px;
width:250px;
background-color:white;
border-radius:5px 5px 0px 0px;
} https://stackoverflow.com/questions/28916617
复制相似问题