<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div style="width: 500px;height:500px;border: 1px solid yellow">
<div style="width: 20%;background-color: red;float: left">a</div>
<div style="width: 30%;background-color: red;float: left">f</div>
<div style="clear: both"></div><!--在所有漂浮的孩子最后加她可以在父类没有高度的情况下,让子类把它撑起来 -->
</div>
</body>
</html>