帮我看一下为什么我的top设置不了高度?
html如下:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link type="text/css" rel="stylesheet" href="practice.css">
</head>
<body>
<div class="top">top</top>
<div class="main">
<div class="right">right</div>
<div class="left">left</div>
</div>
<div class="foot">foot</div>
</body>
</html>
css如下:
body{margin:0 padding:0;font-weight:bold;font-size:30px;}
div{text-align:top left;color:white;}
div.top{
height:100px;
background-color:gray;
}
div.main{
height:600px;
background-color:red;
position:relative;
}
div.left{
width:200px;
height:600px;
position:absolute;
top:0;
left:0;
background-color:blue;
}
div.right{
height:600px;
margin:0 0 0 210px;
background-color:green;
}
div.foot{
height:100px;
background-color:orange;
}