test.html里输入以下代码
<!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>
<body>
<div style="background-color: green">
<div style="float: left; height: 50px; background-color: lightcoral">这个左浮动</div>
<div style="float: right; height: 50px; background-color: lightskyblue">这个右浮动</div>
<div style="clear: both"></div>
</div>
</body>
</html>
注释掉以下代码后
<div style="clear: both"></div>