<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    .container {
      border: 2px solid #0f0;
    }

    .container::after {
      content: "";
      clear: both;
      display: table;
    }

    .child {
      float: left;
      height: 100px;
      width: 100px;
      background: red;
      border: 1px solid #000;
    }
  </style>
</head>
<body>
  <div class="container">
    <div class='child'>
      1
    </div>
    <div class='child'>
      1
    </div>
    <div class='child'>
      1
    </div>
  </div>
</body>
</html>

 

posted on 2020-02-21 09:49  yyy_鸳鸯  阅读(82)  评论(0编辑  收藏  举报