博客列表 >聊天室布局

聊天室布局

拾一枝樱花的博客
拾一枝樱花的博客原创
2019年11月20日 15:54:281757浏览

Html

  1. <div class="mobile-page">
  2. <div class="admin-group">
  3. <img class="admin-img" src="img/60x60.gif"/>
  4. <div class="admin-msg">
  5. <i class="triangle-admin"></i>
  6. <pre class="admin-reply">测试Subject</pre>
  7. </div>
  8. </div>
  9. <div class="user-group">
  10. <div class="user-msg">
  11. <pre class="user-reply">了解了解</pre>
  12. <i class="triangle-user"></i>
  13. </div>
  14. <img class="user-img" src="img/60x60.gif"/>
  15. </div>
  16. </div>
  17. </div>

Css

  1. #service-list .mobile-page pre{ white-space: pre-wrap; word-wrap: break-word; }
  2. .mobile-page{ padding-bottom: 57px; height: 100%; overflow-y: scroll;}
  3. .mobile-page .admin-img, .mobile-page .user-img{ width: 45px; height: 45px; }
  4. i.triangle-admin,i.triangle-user{ width: 0; height: 0; position: absolute; top: 10px; display: inline-block; border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
  5. .mobile-page i.triangle-admin{ left: 4px; border-right: 12px solid #fff; }
  6. .mobile-page i.triangle-user{ right: 4px; border-left: 12px solid #9EEA6A; }
  7. .mobile-page .admin-group, .mobile-page .user-group{ padding: 6px; display: flex; display: -webkit-flex; }
  8. .mobile-page .admin-group{ justify-content: flex-start; -webkit-justify-content: flex-start; }
  9. .mobile-page .user-group{ justify-content: flex-end; -webkit-justify-content: flex-end; }
  10. .mobile-page .admin-reply, .mobile-page .user-reply{ display: inline-block; padding: 8px; border-radius: 4px; background-color: #fff; margin:0 15px; font-size: .8rem; }
  11. .mobile-page .admin-reply{ box-shadow: 0px 0px 2px #ddd; white-space: pre-line;}
  12. .mobile-page .user-reply{ text-align: left; background-color: #9EEA6A; box-shadow: 0px 0px 2px #bbb; white-space: pre-line; }
  13. .mobile-page .user-msg, .mobile-page .admin-msg{ width: 75%; position: relative; }
  14. .mobile-page .user-msg{ text-align: right; }
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议