<div class="im-chat">
    <div class="im-chat-main">
    		<div class="im-chat-row">
            <div class="im-chat-tips">
             	<span class="im-time">18:14</span>
            </div>
        </div>
        <div class="im-chat-row">
            <div class="im-chat-box">
              <div class="im-avatar"><img src="images/avatar2.png" alt=""></div>
              <div class="im-col-chat">
                <div class="im-chat-cont">
                  学习进度怎么样了?
                </div>
              </div>
            </div>
        </div>
        <div class="im-chat-row">
            <div class="im-chat-box">
              <div class="im-avatar"><img src="images/avatar2.png" alt=""></div>
              <div class="im-col-chat">
                <div class="im-chat-cont">
                  学习进度怎么样了?
                </div>
              </div>
            </div>
        </div>
        <div class="im-chat-row">
            <div class="im-chat-box im-chat-guest">
              <div class="im-avatar"><img src="images/avatar3.png" alt=""></div>
              <div class="im-col-chat">
                <div class="im-chat-cont">
                  您好,方便给个电话吗?
                </div>
              </div>
            </div>
        </div>
        <div class="im-chat-row">
            <div class="im-chat-box im-chat-guest">
              <div class="im-avatar"><img src="images/avatar4.png" alt=""></div>
              <div class="im-col-chat">
                <div class="im-chat-cont">
                  您好,方便给个电话吗?
                </div>
              </div>
            </div>
        </div>
    </div>
    <div class="im-chat-footer">
      <input type="text" class="chat-input" placeholder="输入文字内容">
      <button class="btn-chat-send">发送</button>
    </div>
  </div>

.im-chat{
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 50px;
}
.im-chat-footer{
  background: #f1f1f1;
  padding: 8px 10px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: -50px;
  padding-right:75px;
  border-top: 1px solid #e3e3e3
}
.chat-input{
  line-height:36px;
  outline: none;
  padding: 0 10px;
  width: 100%;
  border: 0;
  border-radius: 5px;
  box-sizing: border-box;
  display: block;
}
.im-chat-footer .btn-chat-send{
  padding: 0 15px;
  height: 36px;
  line-height: 32px;
  border: 0;
  outline: none;
  color: #fff;
  background: #428bff;
  border-radius:5px;
  position: absolute;
  right: 10px;
  top: 9px;
}

.im-chat-box{
  overflow: hidden;
}
.im-chat-box .im-avatar{
  width: 40px;
  height: 40px;
  float: left;
}
.im-avatar img{
  width: 40px;
  height: 40px;
  border-radius: 40px;
  display: block;
}
.im-chat-box .im-col-chat{
  overflow: hidden;
  padding-left: 15px;
}
.im-chat-row{
  padding:10px 20px;
}
.im-chat-cont{
  display: inline-block;
  max-width: 60%;
  font-size: 14px;
  line-height: 20px;
  padding:10px;
  position: relative;
  border-radius: 5px;
  background: #fff;
}

.im-chat-cont:after{
  display: block;
  content: ' ';
  width: 0; 
	height: 0; 
	border-top: 8px solid #FFFFFF; 
	border-left: 8px solid transparent; 
  position: absolute;
  left: -8px;
  top: 50%;
  margin-top: -5px;
}


.im-chat-guest .im-avatar{
  float: right;
  margin-right: 0;
}
.im-chat-guest .im-col-chat{
  text-align: right;
  padding-right: 15px;
}
.im-chat-guest .im-chat-cont{
  text-align: right;
  /*background: #a2e555;*/
  color: #333;
}
.im-chat-guest .im-chat-cont:after{
	width: 0; 
	height: 0; 
	border-top: 8px solid #FFFFFF; 
	border-right: 8px solid transparent; 
  position: absolute;
  left: auto;
  right: -8px;
}

.im-chat-main{
  width: 100%;
  padding: 10px 0;
  overflow-y: auto;
  position:absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
}

By lxcss

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注