聊天页面样式

聊天页面样式

代码:

html 复制代码
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="./bootstrap-icons/font/bootstrap-icons.css" />
    <title>Document</title>
    <style>
      * {
        margin: 0px;
        padding: 0px;
      }
      .container {
        width: 100vw;
        height: 100vh;
        background-color: #6d6767;
        display: flex;
        justify-content: center;
        align-items: center;
      }

      .chat-box {
        width: 60%;
        height: 70%;
        background-color: #f8f8f8;
        display: flex;
      }

      .left-box {
        width: 50px;
        background-color: #2e2e2e;
      }

      .right-box {
        flex: 1;
        background-color: #f7f7f7;
        display: flex;
      }
      .main-box {
        flex: 7;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
      }

      .menu-box {
        flex: 3;
        display: flex;
        flex-direction: column;
        border-right: 1px solid #d6d6d6;
      }

      .menu-top {
        height: 60px;
        box-sizing: border-box;
        position: relative;
      }

      .search-box {
        display: flex;
        width: 95%;
        height: 20px;
        justify-content: space-between;
        padding: 4px 5px;
        align-items: center;
        position: absolute;
        bottom: 10px;
      }

      .search-box input {
        line-height: 20px;
        width: 70%;
        border: 0px;
        outline: none;
        background: transparent;
      }

      .search-box i {
        padding: 0px;
        background-color: #d1d1d1;
        border-radius: 2px;
        font-size: 15px;
      }

      .search {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #d1d1d1;
        width: 85%;
        position: relative;
        border-radius: 3px;
      }
      .search i {
        font-size: 12px;
        position: absolute;
        left: 5px;
      }
      .menu-content {
        flex: 1;
        background-color: #d3d1d0;
        height: 100%;
        overflow: hidden;
      }

      .menu-list::-webkit-scrollbar {
        width: 1px;
      }
      .menu-list {
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow-x: hidden;
      }
      .menu-item {
        display: flex;
        justify-content: center;
        height: 60px;
        width: 100%;
        margin: 5px;
      }
      .menu-left img {
        width: 100%;
        height: 100%;
      }
      .menu-right {
        flex: 1;
        display: flex;
        flex-direction: column;
      }
      .menu-right .menu-date {
        font-size: 12px;
        color: #6d6767;
      }
      .menu-right-msg {
        margin-bottom: 5px;
        margin-left: 8px;
        font-size: 12px;
        color: #6d6767;
      }
      .menu-right-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin: auto 10px;
        font-size: 15px;
      }
      .main-top {
        height: 60px;
        border-bottom: 1px solid #d3d1d0;
        display: flex;
        align-items: center;
        font-size: 28px;
        padding-left: 5px;
      }
      .main-content {
        flex: 6;
        border-bottom: 1px solid #d3d1d0;
        overflow-y: auto;
      }

      .main-content::-webkit-scrollbar {
        width: 1px;
      }

      .main-left {
        display: flex;
        margin: 15px auto;
      }

      .main-left img {
        width: 30px;
        height: 30px;
      }

      .main-left .main-msg {
        margin-left: 10px;
        background-color: #ffffff;
        line-height: 30px;
        max-width: 250px;
        font-size: 15px;
        letter-spacing: 5px;
      }

      .main-right {
        display: flex;
        width: 100%;
        flex-direction: row-reverse;
        margin: 15px auto;
      }

      .main-right img {
        width: 30px;
        height: 30px;
      }

      .main-right .main-msg {
        margin-right: 10px;
        background-color: #89d961;
        line-height: 30px;
        max-width: 250px;
        font-size: 15px;
        letter-spacing: 5px;
      }
      .main-input {
        flex: 3;

        display: flex;
        flex-direction: column;
      }

      .main-input-top {
        height: 30px;
        display: flex;
        justify-content: space-between;
        padding: 5px 10px;
      }

      .main-input-top i{
        margin: auto 5px;
      }

      .main-input-content {
        flex: 1;
      }
      .main-input-send {
        height: 50px;
        display: flex;
        align-items: center;
        flex-direction: row-reverse;
        padding-right: 20px;
      }

      .main-input-send a {
        font-size: 15px;
        background: #e9e9e9;
        color: #07c160;
        width: 80px;
        height: 30px;
        border-radius: 2px;
        text-decoration: none;
        cursor: pointer;
        text-align: center;
        line-height: 30px;
      }

      .btn1:hover{
        background: #89d961;
      }

      .main-input-content textarea{
        background: transparent;
        width: 100%;
        border: 0px;
        outline: none;
        height: 100%;
      }



    </style>
  </head>
  <body>
    <div class="container">
      <div class="chat-box">
        <div class="left-box"></div>
        <div class="right-box">
          <div class="menu-box">
            <div class="menu-top">
              <div class="search-box">
                <div class="search">
                  <i class="bi bi-search"></i>
                  <input type="text" placeholder="搜索" />
                </div>
                <i class="bi bi-plus-lg"></i>
              </div>
            </div>
            <div class="menu-content">
              <div class="menu-list">
                <div class="menu-item">
                  <div class="menu-left">
                    <img src="./assets/head.png" alt="" srcset="" />
                  </div>
                  <div class="menu-right">
                    <div class="menu-right-top">
                      <div class="menu-title">张三</div>
                      <div class="menu-date">24/6/10</div>
                    </div>
                    <div class="menu-right-msg">没有其他的了</div>
                  </div>
                </div>
                <div class="menu-item">
                  <div class="menu-left">
                    <img src="./assets/head.png" alt="" srcset="" />
                  </div>
                  <div class="menu-right">
                    <div class="menu-right-top">
                      <div class="menu-title">张三</div>
                      <div class="menu-date">24/6/10</div>
                    </div>
                    <div class="menu-right-msg">没有其他的了</div>
                  </div>
                </div>
                <div class="menu-item">
                  <div class="menu-left">
                    <img src="./assets/head.png" alt="" srcset="" />
                  </div>
                  <div class="menu-right">
                    <div class="menu-right-top">
                      <div class="menu-title">张三</div>
                      <div class="menu-date">24/6/10</div>
                    </div>
                    <div class="menu-right-msg">没有其他的了</div>
                  </div>
                </div>
                <div class="menu-item">
                  <div class="menu-left">
                    <img src="./assets/head.png" alt="" srcset="" />
                  </div>
                  <div class="menu-right">
                    <div class="menu-right-top">
                      <div class="menu-title">张三</div>
                      <div class="menu-date">24/6/10</div>
                    </div>
                    <div class="menu-right-msg">没有其他的了</div>
                  </div>
                </div>
                <div class="menu-item">
                  <div class="menu-left">
                    <img src="./assets/head.png" alt="" srcset="" />
                  </div>
                  <div class="menu-right">
                    <div class="menu-right-top">
                      <div class="menu-title">张三</div>
                      <div class="menu-date">24/6/10</div>
                    </div>
                    <div class="menu-right-msg">没有其他的了</div>
                  </div>
                </div>
                <div class="menu-item">
                  <div class="menu-left">
                    <img src="./assets/head.png" alt="" srcset="" />
                  </div>
                  <div class="menu-right">
                    <div class="menu-right-top">
                      <div class="menu-title">张三</div>
                      <div class="menu-date">24/6/10</div>
                    </div>
                    <div class="menu-right-msg">没有其他的了</div>
                  </div>
                </div>
                <div class="menu-item">
                  <div class="menu-left">
                    <img src="./assets/head.png" alt="" srcset="" />
                  </div>
                  <div class="menu-right">
                    <div class="menu-right-top">
                      <div class="menu-title">张三</div>
                      <div class="menu-date">24/6/10</div>
                    </div>
                    <div class="menu-right-msg">没有其他的了</div>
                  </div>
                </div>
                <div class="menu-item">
                  <div class="menu-left">
                    <img src="./assets/head.png" alt="" srcset="" />
                  </div>
                  <div class="menu-right">
                    <div class="menu-right-top">
                      <div class="menu-title">张三</div>
                      <div class="menu-date">24/6/10</div>
                    </div>
                    <div class="menu-right-msg">没有其他的了</div>
                  </div>
                </div>
                <div class="menu-item">
                  <div class="menu-left">
                    <img src="./assets/head.png" alt="" srcset="" />
                  </div>
                  <div class="menu-right">
                    <div class="menu-right-top">
                      <div class="menu-title">张三</div>
                      <div class="menu-date">24/6/10</div>
                    </div>
                    <div class="menu-right-msg">没有其他的了</div>
                  </div>
                </div>
                <div class="menu-item">
                  <div class="menu-left">
                    <img src="./assets/head.png" alt="" srcset="" />
                  </div>
                  <div class="menu-right">
                    <div class="menu-right-top">
                      <div class="menu-title">张三</div>
                      <div class="menu-date">24/6/10</div>
                    </div>
                    <div class="menu-right-msg">没有其他的了</div>
                  </div>
                </div>
                <div class="menu-item">
                  <div class="menu-left">
                    <img src="./assets/head.png" alt="" srcset="" />
                  </div>
                  <div class="menu-right">
                    <div class="menu-right-top">
                      <div class="menu-title">张三</div>
                      <div class="menu-date">24/6/10</div>
                    </div>
                    <div class="menu-right-msg">没有其他的了</div>
                  </div>
                </div>
                <div class="menu-item">
                  <div class="menu-left">
                    <img src="./assets/head.png" alt="" srcset="" />
                  </div>
                  <div class="menu-right">
                    <div class="menu-right-top">
                      <div class="menu-title">张三</div>
                      <div class="menu-date">24/6/10</div>
                    </div>
                    <div class="menu-right-msg">没有其他的了</div>
                  </div>
                </div>
                <div class="menu-item">
                  <div class="menu-left">
                    <img src="./assets/head.png" alt="" srcset="" />
                  </div>
                  <div class="menu-right">
                    <div class="menu-right-top">
                      <div class="menu-title">张三</div>
                      <div class="menu-date">24/6/10</div>
                    </div>
                    <div class="menu-right-msg">没有其他的了</div>
                  </div>
                </div>
                <div class="menu-item">
                  <div class="menu-left">
                    <img src="./assets/head.png" alt="" srcset="" />
                  </div>
                  <div class="menu-right">
                    <div class="menu-right-top">
                      <div class="menu-title">张三</div>
                      <div class="menu-date">24/6/10</div>
                    </div>
                    <div class="menu-right-msg">没有其他的了</div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="main-box">
            <div class="main-top">
              <div class="main-top title">张三</div>
            </div>
            <div class="main-content">
              <div class="main-left">
                <img src="./assets/head.png" alt="" />
                <div class="main-msg">比如一开始就它显示</div>
              </div>

              <div class="main-right">
                <img src="./assets/head.png" alt="" />
                <div class="main-msg">
                  当块级内容区域超出块级元素范围的时候,就会以滚动条的形式展示,你可以滚动里面的内容,里面的内容不会超出块级区域范围。
                  有时候我们需要自定义滚动条的样式
                </div>
              </div>
              <div class="main-right">
                <img src="./assets/head.png" alt="" />
                <div class="main-msg">web中文字和div常用的居中方法</div>
              </div>
            </div>
            <div class="main-input">
              <div class="main-input-top">
                <div class="main-input-top-left">
                    <i class="bi bi-emoji-smile"></i>
                    <i class="bi bi-folder2"></i>
                    <i class="bi bi-scissors"></i>
                    <i class="bi bi-chat-dots"></i>
                </div>
                <div class="main-input-top-right">
                    <i class="bi bi-telephone"></i>
                    <i class="bi bi-camera-video"></i>
                </div>
              </div>
              <div class="main-input-content">
                <textarea></textarea>
              </div>
              <div class="main-input-send">
                <a class="btn1">发送(S)</a>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
相关推荐
sunshine6411 小时前
【CSS】实现tag选中对钩样式
前端·css·css3
lv程序媛3 小时前
css让按钮放在最右侧
前端·css
温轻舟4 小时前
前端开发 之 12个鼠标交互特效上【附完整源码】
开发语言·前端·javascript·css·html·交互·温轻舟
linda_06076 小时前
定位方式:css
前端·css
安冬的码畜日常7 小时前
【CSS in Depth 2 精译_086】14.3:CSS 剪切路径(clip-path)的用法
前端·css·css3·html5·clip-path·css剪辑·css剪切路径
Amo 67298 小时前
css 裁剪 clip-path
前端·css
前端Hardy10 小时前
HTML&CSS:超级酷炫的3D照片墙
css·html
学代码的小前端13 小时前
0基础学前端-----CSS DAY9
前端·css
唯之为之1 天前
巧用mask属性创建一个纯CSS图标库
css·svg
寻找沙漠的人1 天前
前端知识补充—CSS
前端·css