响应式文字隐藏问题

2021-10-21  本文已影响0人  storyWrite

存在问题布局

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <style>
    .concainer {
      width: 40%;
      margin: 0 auto;
      background-color: green;
    }
    .box {
      display: flex;
      width: 100%;
    }
    .box1 {
      background-color: red;
      width: 100px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .box2 {
      background-color: blue;
      flex: 1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .page {
      display: flex;
    }
    .left {
      flex: 1;
      height: 500px;
      background-color: bisque;
    }
    .right {
      height: 500px;
      width: 33%;
      background-color: red;
    }
  </style>
  <body>
    <div class="page">
      <div class="left">
        左
        <div class="box">
          <div class="box1">11111111111111111111111111</div>
          <div class="box2">
            2222222222222222222222222222222222222222222222333333
          </div>
        </div>
      </div>
      <div class="right">右</div>
    </div>
  </body>
</html>

   .left {
     flex: 1;
     height: 500px;
     min-width: 20px;
     // or 设置overflow:hidden
     background-color: bisque;
   }

+++++++++++++++++++++++++++++后续

上一篇 下一篇

猜你喜欢

热点阅读