前端项目_flex: 1; 的使用

预览效果:

源码演示:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
      body{
          margin:0;
          padding: 0;
      }
    .div1{
        position: relative;
        display: flex;
        width: 100%;
        height: 800px;
    }
    .div2{
        flex: 1;
        background-color: red;
        margin: 23px;
    }
    .div3{
        flex: 1;
        background-color: yellow;
        margin: 23px;
        margin-left: 0;

    }
  </style>
</head>
<body>
<div class="div1">
  <div class="div2"></div>
  <div class="div3"></div>
</div>
</body>
</html>
posted @ 2021-12-21 21:15  博客zhu虎康  阅读(112)  评论(0编辑  收藏  举报