為什么我的left跑到下面去了?求大神指教
<!DOCTYPE html>
<html>
<head>
?? ?<meta charset="UTF-8">
?? ?<title>Document</title>
<style type="text/css">
body{ margin:0; padding:0; font-size:30px; color:#fff}
.top{width:100%;height:100px;background:#ccc;}
.main{width:100%;height:600px;background:red;}
.left{ width:200px;height:600px;background:blue;float: left;}
.right{height:600px;background:#9acc99;margin:0 0 0 210px;}
.foot{width:100%;height:50px;background:#ff6634;}
</style>
</head>
<body>
<div class="top">top</div>
<div class="main">
??? <div class="right">right</div>
??? <div class="left">left</div>
</div>
<div class="foot">foot</div>
</body>
</html>
2018-06-09
body 里面你的div順序是先right 后left,right沒有浮動自占一行,然后下面再排left。
2018-06-07
<style type="text/css">
body{ margin:0; padding:0; font-size:30px; color:#fff}
.top{width:100%;height:100px;background:#ccc;}
.main{width:100%;height:600px;background:red;}
.left{ width:200px;height:600px;background:blue;position: absolute;top: 100px;left: 0}
.right{height:600px;background:#9acc99;margin-left:210px;}
.foot{width:100%;height:50px;background:#ff6634;}
</style>