您的位置:首页 > 其它

左边div固定宽度,右边div宽度自适应

2016-05-17 23:34 405 查看
http://www.zhihu.com/question/37208845
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<style>
body{
padding: 0px;
margin: 0px;
}
.wrap{
width: 100%;
height:500px;
background:red;
}
#dv1{
position:absolute;
top:0px;
left:0px;
width: 200px;
height: 500px;
background:yellow;
/*display: inline-block;*/
}
#dv2{
/*display: inline-block;*/
/*width: auto;*/
height:500px;
background: green;
margin-left: 200px;
}
.wrap2{
width: 100%;
height: 500px;

}
</style>
<body>
<div class="wrap">
<div id="dv1"></div>
<div id="dv2"></div>
</div>
<div class="wrap2"></div>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: