为何我的代码会变成这样,本该在main快里的颜色跑到foot块的下面去了?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>实例1</title>
<style type="text/css">
body{margin:0;padding:0;font-size:20px;font-weight: bold;}
.head{height:100px;background:red;}
.main{height:300px;width:600px;background:#ccc;margin:0 auto;}
.a1{height:300px;width:20%;background:pink;}
.a2{height:300px;width:50%;background:yellow;}
.a3{height:300px;width:30%;background:purple;}
.foot{height:100px;width:600px;background:blue;margin:0 auto;}
</style>
</head>
<body>
<div class="head">head</div>
<div class="main">
<div class="a1">a1</div>
<div class="a2">a2</div>
<div class="a3">a3</div>
</div>
<div class="foot">foot</div>
</body>
</html>