看看我这个错哪了, 为什么左和右放到中间就出问题,单独放一个就没事
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>混合布局</title>
<style>
body{margin: 0;padding: 0;font-size: 20px;font-weight:bold}
div{text-align: center;line-height: 30px}
.top{height: 100px;background: blue}
.main{width: 800px;height: 300px;background: red;margin: 0 auto}
.left{width: 300px;height: 300px;background: yellow;float: left}
.right{width: 500px;height: 300px;background: #369;float: right}
.foot{height: 100px;background: #900;margin: 0 auto}
</style>
</head>
<body>
<div class="top">top</div>
<div class="main">main
<div class="left">left</div>
<div class="right">right</div>
</div>
<div class="foot">foot</div>
</div>
</body>
</html>