关于右边自适应问题
我在父盒子中设置了margin:0 auto;右边的盒子没有设置宽,为什么不能自适应。缩小浏览器窗口后,浏览器下面出现滚动条。
2016-06-27
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<title>混合布局编程挑战</title>
<style type="text/css">
body{ margin:0; padding:0; font-size:30px; color:#fff}
.top{height:100px; background:#ccc;}
.main{width:1000px;background:red;margin:0 auto;position:relative;}
.right{height:500px;background:#9c9;margin-left:210px;}
.left{ width:200px;height:500px;background:#000;position: absolute;left: 0;top: 0;}
.foot{height:50px; background:#ccf;clear:both; }
</style>
</head>
<body>
<div>top</div>
<div>
<div>left</div>
<div>right</div>
</div>
<div>foot</div>
</body>
</html>
代码截图发错了,这个是代码。举报