两列布局 左侧宽度不变右侧宽度自适应
<!DOCTYPE>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>两列布局</title>
<link rel="stylesheet" href="test.css" type="text/css">
</head>
<body>
<div class="one"></div>
<div class="two"></div>
</body>
</html>
第一种方法:
.one {
position: absolute;
height: 200px;
width: 200px;
background: blue;
}
.two {
height: 200px;
margin-left: 200px;
background: red;
}
第二种方法:
.one { float: left; height: 100px; width: 300px; background-color: blue; } .two { overflow: auto; height: 200px; background-color: red; }